diff --git a/app/components/community-menu.jsx b/app/components/community-menu.jsx index f50fee5..11c8044 100644 --- a/app/components/community-menu.jsx +++ b/app/components/community-menu.jsx @@ -585,20 +585,20 @@ export default function CommunityMenu() { const community = data?.community; const channelGroups = community?.channel_groups; + if (!community) { + return null; + } + let serverOwner = false; let manageCommunity = false; let manageChannels = false; let canInvite = false; if (!!me) { - serverOwner = community?.server_owner ?? false; - manageCommunity = community?.permissions?.manage_community ?? false; - manageChannels = community?.permissions?.manage_channels ?? false; - canInvite = community?.permissions?.create_invite ?? false; - } - - if (!community) { - return null; + serverOwner = community.server_owner ?? false; + manageCommunity = community.permissions?.manage_community ?? false; + manageChannels = community.permissions?.manage_channels ?? false; + canInvite = community.permissions?.create_invite ?? false; } return (