fix: a potential crash on fav list (#2716)

This commit is contained in:
Peng Xiao
2023-06-08 20:06:15 +08:00
committed by GitHub
parent 6f411bd459
commit 546d5764e6

View File

@@ -34,7 +34,9 @@ function FavoriteMenuItem({
const referencesToShow = useMemo(() => {
return [
...new Set(
references.filter(ref => !parentIds.has(ref) && !metaMapping[ref].trash)
references.filter(
ref => !parentIds.has(ref) && !metaMapping[ref]?.trash
)
),
];
}, [references, parentIds, metaMapping]);