From 4a976acb84ff828f2ff5745a26b6841093290f54 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 4 Mar 2020 14:18:56 -0700 Subject: [PATCH] Add a null check to getUniqueRoomsWithIndividuals Fixes https://github.com/vector-im/riot-web/issues/12611 --- src/utils/DMRoomMap.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/DMRoomMap.js b/src/utils/DMRoomMap.js index 43ef0035fc..6ce92a0458 100644 --- a/src/utils/DMRoomMap.js +++ b/src/utils/DMRoomMap.js @@ -168,6 +168,7 @@ export default class DMRoomMap { } getUniqueRoomsWithIndividuals(): {[userId: string]: Room} { + if (!this.roomToUser) return {}; // No rooms means no map. return Object.keys(this.roomToUser) .map(r => ({userId: this.getUserIdForRoomId(r), room: this.matrixClient.getRoom(r)})) .filter(r => r.userId && r.room && r.room.getInvitedAndJoinedMemberCount() === 2)