Fix crash when user items page not found

Huh, I'm not sure why Apollo is returning `data: undefined`, when the server is definitely returning the correct no-user-found data in the shape I expect... suspicious :/ well, let's at least stop crashing!
This commit is contained in:
Emi Matchu 2021-01-22 14:38:37 -08:00
parent 9ef73d5cd7
commit 8f8c60d91b

View file

@ -97,7 +97,10 @@ function UserItemsPage() {
return <Box color="red.400">{error.message}</Box>;
}
if (data.user == null) {
// TODO: I'm not sure why, but apparently `data` is `undefined` in the user
// not found case, even though the server is clearly returning
// `{data: {user: null}}`? That's... weird, right? :/
if (data?.user == null) {
return <Box color="red.400">User not found</Box>;
}