diff options
author | xnacly <matteogropp@protonmail.com> | 2021-08-10 20:01:04 +0200 |
---|---|---|
committer | xnacly <matteogropp@protonmail.com> | 2021-08-10 20:01:04 +0200 |
commit | 522c6f8b26a3f949a50fe7aa64c87b728f6549cb (patch) | |
tree | eecf51cbc6ffc9221adc19ed582255041bed7354 | |
parent | added removal of metadata (diff) | |
download | server-522c6f8b26a3f949a50fe7aa64c87b728f6549cb.tar.xz |
catch for missing config error
-rw-r--r-- | src/routes/attachments.ts | 2 |
1 files changed, 1 insertions, 1 deletions
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; |