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