mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 23:05:51 +01:00
client: Fix crash if note tree fails to find a child note
This commit is contained in:
@@ -666,8 +666,9 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
||||
}
|
||||
|
||||
const node = this.prepareNode(branch);
|
||||
|
||||
noteList.push(node);
|
||||
if (node) {
|
||||
noteList.push(node);
|
||||
}
|
||||
}
|
||||
|
||||
return noteList;
|
||||
@@ -709,7 +710,8 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
|
||||
const note = branch.getNoteFromCache();
|
||||
|
||||
if (!note) {
|
||||
throw new Error(`Branch '${branch.branchId}' has no child note '${branch.noteId}'`);
|
||||
console.warn(`Branch '${branch.branchId}' has no child note '${branch.noteId}'`);
|
||||
return null;
|
||||
}
|
||||
|
||||
const title = `${branch.prefix ? (`${branch.prefix} - `) : ""}${note.title}`;
|
||||
|
||||
Reference in New Issue
Block a user