From 2ded7d9b1f4f44b9e5749f554e14fd42a4b9ebb9 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Wed, 7 Sep 2022 08:40:10 +0530 Subject: [PATCH] Fix crash with unknown mime type --- src/util/mimetypes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/mimetypes.js b/src/util/mimetypes.js index 7a94e0c..bf7efbc 100644 --- a/src/util/mimetypes.js +++ b/src/util/mimetypes.js @@ -26,6 +26,7 @@ export const ALLOWED_BLOB_MIMETYPES = [ ]; export function getBlobSafeMimeType(mimetype) { + if (typeof mimetype !== 'string') return 'application/octet-stream'; const [type] = mimetype.split(';'); if (!ALLOWED_BLOB_MIMETYPES.includes(type)) { return 'application/octet-stream';