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

(cherry picked from commit 546d5764e6)
This commit is contained in:
Peng Xiao authored and Alex Yang committed 2023-06-20 14:44:27 +08:00
1 parent e6c3c6b5f7
commit 8cb095a28a
1 file changed
+3 -1
@@ -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]);