Fix crash on unable to getContent of tombstoned room

This commit is contained in:
Ajay Bura 2022-04-16 20:53:24 +05:30 committed by GitHub
parent cd5ae4cb7f
commit ba0de8800a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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