Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(note_icon): crash when reducing number of items
Elian Doranbecf4d742610
diff --git a/apps/client/src/widgets/note_icon.tsx b/apps/client/src/widgets/note_icon.tsxindex 76d8cbed09..70d79fb657 100644--- a/apps/client/src/widgets/note_icon.tsx+++ b/apps/client/src/widgets/note_icon.tsx@@ -155,7 +155,9 @@ function IconItemCell({ rowIndex, columnIndex, style, filteredIcons }: CellCompofilteredIcons: IconWithName[];}>): React.JSX.Element {const iconIndex = rowIndex * 12 + columnIndex;- const iconData = filteredIcons[iconIndex];+ const iconData = filteredIcons[iconIndex] as IconWithName | undefined;+ if (!iconData) return <span style={style as CSSProperties} />;+const { id, terms, iconPack } = iconData;return (<span