From bb46c1f18421bff695ef3dca3e4b9a41841c53d9 Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 23 Oct 2020 22:19:54 -0700 Subject: [PATCH] fix crash opening user items page logged out --- src/app/UserItemsPage.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/UserItemsPage.js b/src/app/UserItemsPage.js index e1eb187..0620719 100644 --- a/src/app/UserItemsPage.js +++ b/src/app/UserItemsPage.js @@ -70,9 +70,11 @@ function UserItemsPage() { return {error.message}; } - const itemIdsYouOwn = new Set(data.currentUser.itemsTheyOwn.map((i) => i.id)); + const itemIdsYouOwn = new Set( + data.currentUser?.itemsTheyOwn.map((i) => i.id) || [] + ); const itemIdsYouWant = new Set( - data.currentUser.itemsTheyWant.map((i) => i.id) + data.currentUser?.itemsTheyWant.map((i) => i.id) || [] ); // This helps you compare your owns/wants to other users! If they own