Skip to content

Commit 280f26b

Browse files
Maciekmaciej-barczak-red
authored andcommitted
BUG FIX: Change the way of checking for empty array
The original condition : attachments !== [] always returns true, for empty array, as well as for array with elements.
1 parent 0af581c commit 280f26b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

browser/main/lib/dataApi/attachmentManagement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function createAttachmentDestinationFolder (destinationStoragePath, noteKey) {
8484
function migrateAttachments (markdownContent, storagePath, noteKey) {
8585
if (noteKey !== undefined && sander.existsSync(path.join(storagePath, 'images'))) {
8686
const attachments = getAttachmentsInMarkdownContent(markdownContent) || []
87-
if (attachments !== []) {
87+
if (attachments.length) {
8888
createAttachmentDestinationFolder(storagePath, noteKey)
8989
}
9090
for (const attachment of attachments) {

0 commit comments

Comments
 (0)