From ba0de8800a2b8528ade28b61d27cbc22a3605da2 Mon Sep 17 00:00:00 2001 From: Ajay Bura <32841439+ajbura@users.noreply.github.com> Date: Sat, 16 Apr 2022 20:53:24 +0530 Subject: [PATCH] Fix crash on unable to getContent of tombstoned room --- src/client/state/RoomList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/state/RoomList.js b/src/client/state/RoomList.js index f1e0d6d..8b7cdc1 100644 --- a/src/client/state/RoomList.js +++ b/src/client/state/RoomList.js @@ -206,7 +206,7 @@ class RoomList extends EventEmitter { this.matrixClient.getRooms().forEach((room) => { const { roomId } = room; const tombstone = room.currentState.events.get('m.room.tombstone'); - if (typeof tombstone !== 'undefined') { + if (tombstone?.get('') !== undefined) { const repRoomId = tombstone.get('').getContent().replacement_room; const repRoomMembership = this.matrixClient.getRoom(repRoomId)?.getMyMembership(); if (repRoomMembership === 'join') return;