1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

catch for missing config error

This commit is contained in:
xnacly 2021-08-10 20:01:04 +02:00
parent e8052ce7fc
commit 522c6f8b26

View File

@ -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;