diff --git a/src/utils/collection/index.ts b/src/utils/collection/index.ts index 5a0ed6d67..1c13c40c1 100644 --- a/src/utils/collection/index.ts +++ b/src/utils/collection/index.ts @@ -66,8 +66,12 @@ export function isSharedCollection( collectionID: number ) { const user: User = getData(LS_KEYS.USER); - return ( - collections.find((collection) => collection.id === collectionID)?.owner - .id !== user.id + + const collection = collections.find( + (collection) => collection.id === collectionID ); + if (!collection) { + return false; + } + return collection?.owner.id !== user.id; }