From 8ca1243ecb9219fd99a55e895310529689831324 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 3 Apr 2018 17:35:34 +0100 Subject: [PATCH] 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 https://github.com/vector-im/riot-web/issues/6432 --- src/components/views/avatars/RoomAvatar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/avatars/RoomAvatar.js b/src/components/views/avatars/RoomAvatar.js index e547cf0fa7..ef69bcb60a 100644 --- a/src/components/views/avatars/RoomAvatar.js +++ b/src/components/views/avatars/RoomAvatar.js @@ -66,7 +66,8 @@ module.exports = React.createClass({ }, onRoomStateEvents: function(ev) { - if (ev.getRoomId() !== this.props.room.roomId || + if (!this.props.room || + ev.getRoomId() !== this.props.room.roomId || ev.getType() !== 'm.room.avatar' ) return;