summary refs log tree commit diff
diff options
context:
space:
mode:
authorxnacly <matteogropp@protonmail.com>2021-08-10 20:01:04 +0200
committerxnacly <matteogropp@protonmail.com>2021-08-10 20:01:04 +0200
commit522c6f8b26a3f949a50fe7aa64c87b728f6549cb (patch)
treeeecf51cbc6ffc9221adc19ed582255041bed7354
parentadded removal of metadata (diff)
downloadserver-522c6f8b26a3f949a50fe7aa64c87b728f6549cb.tar.xz
catch for missing config error
-rw-r--r--src/routes/attachments.ts2
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;