mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
remove broken note from note list
When .cson is broken and catch error in processing this file, undefined is collected in notes. remved broken note(s) from notes list.
This commit is contained in:
@@ -27,9 +27,12 @@ function resolveStorageNotes (storage) {
|
||||
data.storage = storage.key
|
||||
return data
|
||||
} catch (err) {
|
||||
console.error(notePath)
|
||||
console.error(`error on note path: ${notePath}, error: ${err}`)
|
||||
}
|
||||
})
|
||||
.filter(function filterOnlyNoteObject (noteObj) {
|
||||
return typeof noteObj === 'object'
|
||||
})
|
||||
|
||||
return Promise.resolve(notes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user