Merge pull request #1821 from matrix-org/luke/fix-room-avatar-null-room

Add null-guard to prevent RoomAvatar NPE when room is null
pull/21833/head
Luke Barnard 2018-04-03 17:51:56 +01:00 committed by GitHub
commit 7273921706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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;