Skip to content

Build your personal knowledge base with Trilium Notes

fix(react/type_widgets): crash when switching between relation maps

Elian Doran08fae19d19e2
diff --git a/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx b/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx
index 75d087a445..ede8974c80 100644
--- a/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx
+++ b/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx
@@ -269,6 +269,7 @@ async function useRelationData(noteId: string, mapData: MapData | undefined, map
target: noteIdToId(relation.targetNoteId),
type: relation.type
});
+ if (!connection) return;
// TODO: Does this actually do anything.
//@ts-expect-error