diff --git a/src/routes/api/attachments.ts b/src/routes/api/attachments.ts index b0b46db1f..718c99914 100644 --- a/src/routes/api/attachments.ts +++ b/src/routes/api/attachments.ts @@ -43,7 +43,14 @@ function saveAttachment(req: Request) { function uploadAttachment(req: Request) { const { noteId } = req.params; - const { file } = req as any; + const { file } = req; + + if (!file) { + return { + uploaded: false, + message: `Missing attachment data.` + }; + } const note = becca.getNoteOrThrow(noteId); let url;