From 5e843f7a4fcbf43904ee340495fc474b2290db98 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Thu, 13 Jan 2022 10:33:04 +0530 Subject: [PATCH] Fix crash in profile viewer Signed-off-by: Ajay Bura --- src/app/organisms/profile-viewer/ProfileViewer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/organisms/profile-viewer/ProfileViewer.jsx b/src/app/organisms/profile-viewer/ProfileViewer.jsx index 320cf2c..2389012 100644 --- a/src/app/organisms/profile-viewer/ProfileViewer.jsx +++ b/src/app/organisms/profile-viewer/ProfileViewer.jsx @@ -358,7 +358,7 @@ function ProfileViewer() { const renderProfile = () => { const roomMember = room.getMember(userId); const username = roomMember ? getUsernameOfRoomMember(roomMember) : getUsername(userId); - const avatarMxc = roomMember?.getMxcAvatarUrl?.() || mx.getUser(userId).avatarUrl; + const avatarMxc = roomMember?.getMxcAvatarUrl?.() || mx.getUser(userId)?.avatarUrl; const avatarUrl = (avatarMxc && avatarMxc !== 'null') ? mx.mxcUrlToHttp(avatarMxc, 80, 80, 'crop') : null; const powerLevel = roomMember.powerLevel || 0;