diff --git a/src/routes/api/note_map.js b/src/routes/api/note_map.js index 6f5dd38d2..09b593c7f 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) {