From 1754557af46f8b24a7277fb1e5fe77a75cb6688b Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 18 Jul 2021 19:51:19 +0200 Subject: fix attachment --- src/routes/attachments.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/routes/attachments.ts b/src/routes/attachments.ts index acc7604d..9d43a921 100644 --- a/src/routes/attachments.ts +++ b/src/routes/attachments.ts @@ -11,6 +11,7 @@ const router = Router(); router.post("/:channel_id", multer.single("file"), async (req: Request, res: Response) => { if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature"); + if (!req.file) return; const { buffer, mimetype, size, originalname, fieldname } = req.file; const { channel_id } = req.params; -- cgit 1.5.1