mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	make getAncestors safe in respect to saved search
				
					
				
			This commit is contained in:
		@@ -865,10 +865,12 @@ class Note extends AbstractEntity {
 | 
				
			|||||||
            this.ancestorCache = [];
 | 
					            this.ancestorCache = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for (const parent of this.parents) {
 | 
					            for (const parent of this.parents) {
 | 
				
			||||||
                if (!noteIds.has(parent.noteId)) {
 | 
					                if (noteIds.has(parent.noteId)) {
 | 
				
			||||||
 | 
					                    continue;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                this.ancestorCache.push(parent);
 | 
					                this.ancestorCache.push(parent);
 | 
				
			||||||
                noteIds.add(parent.noteId);
 | 
					                noteIds.add(parent.noteId);
 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                for (const ancestorNote of parent.getAncestors()) {
 | 
					                for (const ancestorNote of parent.getAncestors()) {
 | 
				
			||||||
                    if (!noteIds.has(ancestorNote.noteId)) {
 | 
					                    if (!noteIds.has(ancestorNote.noteId)) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user