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

Added a few more checks in related methods to prevent simular errors

This commit is contained in:
Milo Todt
2019-01-13 18:35:24 -08:00
parent 99b53f4a55
commit 8d817066e8

View File

@@ -40,6 +40,7 @@ function init () {
const fetchNotes = function (storages) {
const findNotesFromEachStorage = storages
.filter(storage => fs.existsSync(storage.path))
.map((storage) => {
return resolveStorageNotes(storage)
.then((notes) => {
@@ -54,7 +55,7 @@ function init () {
})
}
})
if (unknownCount > 0) {
if (unknownCount > 0 && fs.existsSync(storage.path)) {
CSON.writeFileSync(path.join(storage.path, 'boostnote.json'), _.pick(storage, ['folders', 'version']))
}
return notes