From 422d4cd73a7c5223ba5f886314f06be2ad5c1ae1 Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 13 Jan 2020 11:18:24 +0000 Subject: [PATCH] small simplification in code as `.getContent()` will always return an object --- src/components/views/rooms/RoomTile.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 232e11cfd8..fd06962a99 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -112,8 +112,7 @@ module.exports = createReactClass({ onJoinRule: function(ev) { if (ev.getType() !== "m.room.join_rules") return; if (ev.getRoomId() !== this.props.room.roomId) return; - const joinRule = (ev.getContent() || {}).join_rule; - this.setState({ joinRule }); + this.setState({ joinRule: ev.getContent().join_rule }); }, onAccountData: function(accountDataEvent) {