Fix crash on unable to getContent of tombstoned room
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Sat, 16 Apr 2022 15:23:24 +0000 (20:53 +0530)
committerGitHub <noreply@github.com>
Sat, 16 Apr 2022 15:23:24 +0000 (20:53 +0530)
src/client/state/RoomList.js

index f1e0d6d00c08bcf7e7057245bb6f19678a76fa1d..8b7cdc197c82e23d07cc3eabfe9bf8da8217f07e 100644 (file)
@@ -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;