mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
Added a few more checks in related methods to prevent simular errors
This commit is contained in:
@@ -40,6 +40,7 @@ function init () {
|
|||||||
|
|
||||||
const fetchNotes = function (storages) {
|
const fetchNotes = function (storages) {
|
||||||
const findNotesFromEachStorage = storages
|
const findNotesFromEachStorage = storages
|
||||||
|
.filter(storage => fs.existsSync(storage.path))
|
||||||
.map((storage) => {
|
.map((storage) => {
|
||||||
return resolveStorageNotes(storage)
|
return resolveStorageNotes(storage)
|
||||||
.then((notes) => {
|
.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']))
|
CSON.writeFileSync(path.join(storage.path, 'boostnote.json'), _.pick(storage, ['folders', 'version']))
|
||||||
}
|
}
|
||||||
return notes
|
return notes
|
||||||
|
|||||||
Reference in New Issue
Block a user