Skip to content

Commit

Permalink
Quick nullchecks on loaded user
Browse files Browse the repository at this point in the history
Bit of a hack attempt to fix some issues that have been reported
  • Loading branch information
vcarl committed Jun 3, 2024
1 parent 3ef60e3 commit 54f95c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/DiscordAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const checkAuth = async (
headers: { "x-auth": stored.token },
});
const loadedUser = (await res.json()) as DiscordIdentity;
if (!loadedUser.user.email || !loadedUser.user.verified) {
if (!loadedUser?.user?.email || !loadedUser.user.verified) {
return "needsVerify";
}
if (!loadedUser.isMember) {
Expand Down

0 comments on commit 54f95c5

Please sign in to comment.