mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
editor: fix crash due to attachment.mime being undefined
This commit is contained in:
@@ -103,7 +103,10 @@ const previewableMimeTypes = ["application/pdf"];
|
||||
|
||||
function canPreviewAttachment(attachment: Attachment) {
|
||||
if (!attachment) return false;
|
||||
if (previewableMimeTypes.some((mime) => attachment.mime.startsWith(mime)))
|
||||
if (
|
||||
attachment.mime &&
|
||||
previewableMimeTypes.some((mime) => attachment.mime.startsWith(mime))
|
||||
)
|
||||
return true;
|
||||
|
||||
const extension = attachment.filename?.split(".").pop();
|
||||
|
||||
Reference in New Issue
Block a user