avoid app crash when profile of a new item is opened

This commit is contained in:
Anton Tranelis 2025-07-11 09:57:00 +02:00
parent ed4cdce37c
commit 582258ea90

View File

@ -10,7 +10,7 @@ interface Props {
export const RelationsView = ({ item, relation }: Props) => {
const items = useItems()
if (!item.relations) throw new Error('Item does not have relations defined.')
if (!item.relations) return
const relationsOfRightType = item.relations.filter((r) => r.type === relation)