mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	client: Fix crash if note tree fails to find a child note
This commit is contained in:
		
							parent
							
								
									560467bdba
								
							
						
					
					
						commit
						70d55097ee
					
				| @ -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}`; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran