diff --git a/browser/main/lib/dataApi/attachmentManagement.js b/browser/main/lib/dataApi/attachmentManagement.js index 088fb054..46560a1a 100644 --- a/browser/main/lib/dataApi/attachmentManagement.js +++ b/browser/main/lib/dataApi/attachmentManagement.js @@ -82,7 +82,7 @@ function createAttachmentDestinationFolder (destinationStoragePath, noteKey) { * @param noteKey Key of the current note */ function migrateAttachments (markdownContent, storagePath, noteKey) { - if (sander.existsSync(path.join(storagePath, 'images'))) { + if (noteKey !== undefined && sander.existsSync(path.join(storagePath, 'images'))) { const attachments = getAttachmentsInMarkdownContent(markdownContent) || [] if (attachments !== []) { createAttachmentDestinationFolder(storagePath, noteKey)