Skip to content

Commit

Permalink
Merge pull request #611 from asmsuechan/error-handling-for-loading-notes
Browse files Browse the repository at this point in the history
Fix errorhandling on cases of invalid notes
  • Loading branch information
asmsuechan authored Jun 16, 2017
2 parents b91ddfa + 95e7f4f commit 68b91bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browser/main/lib/dataApi/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function init () {
.then((notes) => {
let unknownCount = 0
notes.forEach((note) => {
if (!storage.folders.some((folder) => note.folder === folder.key)) {
if (note && !storage.folders.some((folder) => note.folder === folder.key)) {
unknownCount++
storage.folders.push({
key: note.folder,
Expand Down
1 change: 0 additions & 1 deletion browser/main/lib/dataApi/resolveStorageNotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function resolveStorageNotes (storage) {
return data
} catch (err) {
console.error(notePath)
throw err
}
})

Expand Down
3 changes: 2 additions & 1 deletion browser/main/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function data (state = defaultDataMap(), action) {
state.storageMap.set(storage.key, storage)
})

action.notes.forEach((note) => {
action.notes.some((note) => {
if (note === undefined) return true
let uniqueKey = note.storage + '-' + note.key
let folderKey = note.storage + '-' + note.folder
state.noteMap.set(uniqueKey, note)
Expand Down

0 comments on commit 68b91bf

Please sign in to comment.