Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d5e9d53

Browse files
authored
Merge pull request #5330 from matrix-org/travis/fix-user-info
Don't show admin tooling if we're not in the room
2 parents 3a0833e + 5f3f7b5 commit d5e9d53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/views/right_panel/UserInfo.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,11 @@ const RoomAdminToolsContainer: React.FC<IBaseRoomProps> = ({
801801
} = powerLevels;
802802

803803
const me = room.getMember(cli.getUserId());
804+
if (!me) {
805+
// we aren't in the room, so return no admin tooling
806+
return <div />;
807+
}
808+
804809
const isMe = me.userId === member.userId;
805810
const canAffectUser = member.powerLevel < me.powerLevel || isMe;
806811

0 commit comments

Comments
 (0)