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

Commit ef427ea

Browse files
committed
Add null-guard to prevent RoomAvatar NPE when room is null
which may have been occuring when peeking into a room that the client hasn't got a Room object for. Fixes element-hq/element-web#6432
1 parent 6cb9d28 commit ef427ea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/views/avatars/RoomAvatar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ module.exports = React.createClass({
6666
},
6767

6868
onRoomStateEvents: function(ev) {
69-
if (ev.getRoomId() !== this.props.room.roomId ||
69+
if (!this.props.room ||
70+
ev.getRoomId() !== this.props.room.roomId ||
7071
ev.getType() !== 'm.room.avatar'
7172
) return;
7273

0 commit comments

Comments
 (0)