From cfd20c7e85c75671bf408c8eea6e3114bd78696d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 25 Jul 2018 16:08:44 +0200 Subject: [PATCH] fix error/tests --- src/stores/RoomListStore.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index 38ad7e0b3d..e415389423 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -173,11 +173,13 @@ class RoomListStore extends Store { if (!this._matrixClient) return; this._matrixClient.getRooms().forEach((room, index) => { - const membership = room.getMyMembership(this._matrixClient.getUserId()); + const myUserId = this._matrixClient.getUserId(); + const membership = room.getMyMembership(myUserId); + const me = room.getMember(myUserId); if (membership == "invite") { lists["im.vector.fake.invite"].push(room); - } else if (membership == "join" || membership === "ban" || me.isKicked()) { + } else if (membership == "join" || membership === "ban" || (me && me.isKicked())) { // Used to split rooms via tags let tagNames = Object.keys(room.tags);