1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

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.
This commit is contained in:
Maciek
2018-07-28 22:25:10 +02:00
parent 1d1ab65edd
commit 4a3bcaba06

View File

@@ -84,7 +84,7 @@ function createAttachmentDestinationFolder (destinationStoragePath, noteKey) {
function migrateAttachments (markdownContent, storagePath, noteKey) {
if (noteKey !== undefined && sander.existsSync(path.join(storagePath, 'images'))) {
const attachments = getAttachmentsInMarkdownContent(markdownContent) || []
if (attachments !== []) {
if (attachments.length) {
createAttachmentDestinationFolder(storagePath, noteKey)
}
for (const attachment of attachments) {