Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
not finding node for a note path does not have to be always an error
zadam0cfd95d9b82b
diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.jsindex 34121b80fc..082ca86ec1 100644--- a/src/public/app/widgets/note_tree.js+++ b/src/public/app/widgets/note_tree.js@@ -797,8 +797,10 @@ export default class NoteTreeWidget extends TabAwareWidget {const node = await this.expandToNote(activeContext.notePath);- await node.makeVisible({scrollIntoView: true});- node.setActive(true, {noEvents: true, noFocus: false});+ if (node) {+ await node.makeVisible({scrollIntoView: true});+ node.setActive(true, {noEvents: true, noFocus: false});+ }}}@@ -851,7 +853,11 @@ export default class NoteTreeWidget extends TabAwareWidget {// these are real notes with real notePath, user can display them in a detail// but they don't have a node in the tree- ws.logError(`Can't find node for child node of noteId=${childNoteId} for parent of noteId=${parentNode.data.noteId} and hoistedNoteId=${hoistedNoteService.getHoistedNoteId()}, requested path is ${notePath}`);+ const childNote = await treeCache.getNote(childNoteId);++ if (!childNote || childNote.type !== 'image') {+ ws.logError(`Can't find node for child node of noteId=${childNoteId} for parent of noteId=${parentNode.data.noteId} and hoistedNoteId=${hoistedNoteService.getHoistedNoteId()}, requested path is ${notePath}`);+ }}return;