Skip to content

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

core: fix undefined is not an object when publishing empty note

Abdullah Attaa6ebe092e86f
diff --git a/packages/core/src/collections/content.js b/packages/core/src/collections/content.js
index 5d5ee4bca..3823fd59a 100644
--- a/packages/core/src/collections/content.js
+++ b/packages/core/src/collections/content.js
@@ -116,6 +116,7 @@ export default class Content extends Collection {
}
async downloadMedia(groupId, contentItem, notify = true) {
+ if (!contentItem) return contentItem;
const content = getContentFromData(contentItem.type, contentItem.data);
contentItem.data = await content.insertMedia(async (hashes) => {
const attachments = hashes.map((h) => this._db.attachments.attachment(h));