From 6ba74769bf754933fb616e64f3369aaa279046d6 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 7a94e0c8..bf7efbce 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';