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:
parent
9ef73d5cd7
commit
8f8c60d91b
1 changed files with 4 additions and 1 deletions
|
@ -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>;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue