mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +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); |             const node = this.prepareNode(branch); | ||||||
|  |             if (node) { | ||||||
|             noteList.push(node); |                 noteList.push(node); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         return noteList; |         return noteList; | ||||||
| @@ -709,7 +710,8 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { | |||||||
|         const note = branch.getNoteFromCache(); |         const note = branch.getNoteFromCache(); | ||||||
|  |  | ||||||
|         if (!note) { |         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}`; |         const title = `${branch.prefix ? (`${branch.prefix} - `) : ""}${note.title}`; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user