From 1fb43b7dfe120539038905ab6d5b36a60e85a8ca Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Mon, 26 Jun 2023 12:30:56 +0500 Subject: [PATCH] core: export with empty content if no content found --- packages/core/models/note.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/models/note.js b/packages/core/models/note.js index 7d33bcb12..85471b7b2 100644 --- a/packages/core/models/note.js +++ b/packages/core/models/note.js @@ -30,7 +30,7 @@ export default class Note { /** * * @param {import('../api').default} db - * @param {Object} note + * @param {any} note */ constructor(note, db) { this._note = note; @@ -97,9 +97,11 @@ export default class Note { createdOn: formatDate(this.data.dateCreated), tags: this.tags.join(", ") }; - contentItem = - contentItem || (await this._db.content.raw(this._note.contentId)); - if (!contentItem) return false; + contentItem = contentItem || + (await this._db.content.raw(this._note.contentId)) || { + type: "tiptap", + data: "

" + }; const { data, type } = await this._db.content.downloadMedia( `export-${this.id}`, contentItem,