Skip to content

Commit 45cca9e

Browse files
committed
Desktop: Fixes #2079: Do not crash when a notebook parent does not exist
1 parent 76ecfd0 commit 45cca9e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ReactNativeClient/lib/models/Folder.js

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class Folder extends BaseItem {
121121
let parentId = noteCount.folder_id;
122122
do {
123123
let folder = foldersById[parentId];
124+
if (!folder) break; // https://github.com/laurent22/joplin/issues/2079
124125
folder.note_count = (folder.note_count || 0) + noteCount.note_count;
125126
parentId = folder.parent_id;
126127
} while (parentId);

0 commit comments

Comments
 (0)