Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: don't return invalid dataurl if image doesn't exist

Abdullah Attabc433c56aebd
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index 311c12450..0e59f8782 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -250,6 +250,8 @@ export default class Attachments extends Collection {
outputType
}
);
+ if (!data) return;
+
return outputType === "base64"
? dataurl.fromObject({ type: attachment.metadata.type, data })
: data;