mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	chore(highlights): prevent crash if unable to find target element
This commit is contained in:
		
							parent
							
								
									04a7ad8d4e
								
							
						
					
					
						commit
						a44bf7fb49
					
				@ -350,11 +350,13 @@ export default class HighlightsListWidget extends RightPanelWidget {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (targetElement) {
 | 
					        if (targetElement && targetElement[itemIndex]) {
 | 
				
			||||||
            targetElement[itemIndex].scrollIntoView({
 | 
					            targetElement[itemIndex].scrollIntoView({
 | 
				
			||||||
                behavior: "smooth",
 | 
					                behavior: "smooth",
 | 
				
			||||||
                block: "center"
 | 
					                block: "center"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            console.warn("Unable to find the target element in the highlights list.");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user