From 5f3f7b5263ee44d8dfc903474d8316f3ed7b99de Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 16 Oct 2020 13:43:08 -0600 Subject: [PATCH] Don't show admin tooling if we're not in the room Fixes https://github.com/vector-im/element-web/issues/15480 --- src/components/views/right_panel/UserInfo.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 807bd27796..dd291b1fa1 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -801,6 +801,11 @@ const RoomAdminToolsContainer: React.FC = ({ } = powerLevels; const me = room.getMember(cli.getUserId()); + if (!me) { + // we aren't in the room, so return no admin tooling + return
; + } + const isMe = me.userId === member.userId; const canAffectUser = member.powerLevel < me.powerLevel || isMe;