From 522c6f8b26a3f949a50fe7aa64c87b728f6549cb Mon Sep 17 00:00:00 2001 From: xnacly Date: Tue, 10 Aug 2021 20:01:04 +0200 Subject: [PATCH] catch for missing config error --- src/routes/attachments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/attachments.ts b/src/routes/attachments.ts index 9d208485..c387aa37 100644 --- a/src/routes/attachments.ts +++ b/src/routes/attachments.ts @@ -19,7 +19,7 @@ router.post("/:channel_id", multer.single("file"), async (req: Request, res: Res const id = Snowflake.generate(); const path = `attachments/${channel_id}/${id}/${filename}`; - const endpoint = Config.get().cdn.endpoint || "http://localhost:3003"; + const endpoint = Config.get()?.cdn.endpoint || "http://localhost:3003"; await storage.set(path, buffer); var width;