Skip to content

Commit

Permalink
Null check for organization data added
Browse files Browse the repository at this point in the history
  • Loading branch information
raggettii committed Dec 9, 2024
1 parent da0b9c0 commit ef9bef6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ const LeaveOrganization = (): JSX.Element => {
if (orgLoading) return <Spinner animation="border" />;
if (orgError) return <p>Error: {orgError.message}</p>;

if (!orgData?.organizations?.length) {
return <p>Organization not found</p>;
}

const organization = orgData?.organizations[0];

return (
Expand Down

0 comments on commit ef9bef6

Please sign in to comment.