1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

OnBlur throws exceptions if the notetype is snippet -> Fixes #1962

This commit is contained in:
ehhc
2018-05-23 19:47:41 +02:00
parent 0ca4e6ca4f
commit 2f4eb595f6

View File

@@ -232,6 +232,7 @@ function deleteAttachmentFolder (storageKey, noteKey) {
* @param noteKey NoteKey of the current note. Is used to determine the belonging attachment folder.
*/
function deleteAttachmentsNotPresentInNote (markdownContent, storageKey, noteKey) {
if (storageKey && noteKey && markdownContent !== null && typeof markdownContent !== 'undefined') {
const targetStorage = findStorage.findStorage(storageKey)
const attachmentFolder = path.join(targetStorage.path, DESTINATION_FOLDER, noteKey)
const attachmentsInNote = getAttachmentsInContent(markdownContent)
@@ -266,6 +267,7 @@ function deleteAttachmentsNotPresentInNote (markdownContent, storageKey, noteKey
} else {
console.info("Attachment folder ('" + attachmentFolder + "') did not exist..")
}
}
}
module.exports = {