Skip to content

Build your personal knowledge base with Trilium Notes

extra null relation checks in notemap

zadam5a3c50d9fb99
diff --git a/src/routes/api/note_map.js b/src/routes/api/note_map.js
index 45b438d898..4cbfb8a820 100644
--- a/src/routes/api/note_map.js
+++ b/src/routes/api/note_map.js
@@ -48,7 +48,7 @@ function getNeighbors(note, depth) {
const targetNote = relation.getTargetNote();
- if (targetNote.hasLabel('excludeFromNoteMap')) {
+ if (!targetNote || targetNote.hasLabel('excludeFromNoteMap')) {
continue;
}
@@ -67,7 +67,7 @@ function getNeighbors(note, depth) {
const sourceNote = relation.getNote();
- if (sourceNote.hasLabel('excludeFromNoteMap')) {
+ if (!sourceNote || sourceNote.hasLabel('excludeFromNoteMap')) {
continue;
}