mirror of
https://github.com/laurent22/joplin.git
synced 2025-03-29 21:21:15 +02:00
Mobile: Fixes #1068: Handle case where notebook has a parent that no longer exists
This commit is contained in:
parent
f308fe71f9
commit
30201249b5
@ -167,7 +167,13 @@ class Folder extends BaseItem {
|
|||||||
if (!folder.parent_id) {
|
if (!folder.parent_id) {
|
||||||
rootFolders.push(folder);
|
rootFolders.push(folder);
|
||||||
} else {
|
} else {
|
||||||
idToFolders[folder.parent_id].children.push(folder);
|
if (!idToFolders[folder.parent_id]) {
|
||||||
|
// It means the notebook is refering a folder that doesn't exist. In theory it shouldn't happen
|
||||||
|
// but sometimes does - https://github.com/laurent22/joplin/issues/1068#issuecomment-450594708
|
||||||
|
rootFolders.push(folder);
|
||||||
|
} else {
|
||||||
|
idToFolders[folder.parent_id].children.push(folder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user