From 4961d9bb89cfbfc0f62972ee3549cd376a488992 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 14 Nov 2022 21:03:14 +0100 Subject: [PATCH] avoid errors on dead backlinks, #3289 --- src/routes/api/note_map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {