Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix crash when shift+click on toc item Signed-off-by: 01zulfi <[email protected]>

01zulfi7812c15b48ec
diff --git a/apps/web/src/components/virtualized-tree/index.tsx b/apps/web/src/components/virtualized-tree/index.tsx
index d56fed135..ee0f6dc61 100644
--- a/apps/web/src/components/virtualized-tree/index.tsx
+++ b/apps/web/src/components/virtualized-tree/index.tsx
@@ -177,7 +177,7 @@ export function VirtualizedTree<T>(props: TreeViewProps<T>) {
const ids =
indices.length === nodes.length
? nodes.map((c) => c.id)
- : (indices.map((i) => nodes[i].id).filter(Boolean) as string[]);
+ : (indices.map((i) => nodes[i]?.id).filter(Boolean) as string[]);
bulkSelect?.(ids);
},
focusItemAt: (index) => {