Skip to content

Build your personal knowledge base with Trilium Notes

avoid errors on dead backlinks, #3289

zadam4961d9bb89cf
diff --git a/src/routes/api/note_map.js b/src/routes/api/note_map.js
index 6f5dd38d23..09b593c7fe 100644
--- a/src/routes/api/note_map.js
+++ b/src/routes/api/note_map.js
@@ -317,7 +317,7 @@ function findExcerpts(sourceNote, referencedNoteId) {
function getFilteredBacklinks(note) {
return note.getTargetRelations()
// search notes have "ancestor" relations which are not interesting
- .filter(note => note.getNote().type !== 'search');
+ .filter(relation => !!relation.getNote() && relation.getNote().type !== 'search');
}
function getBacklinkCount(req) {