From 8fc244452ce2f2d40643b2ddc1d22085d62bb9ea Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 18 Feb 2021 18:06:26 +0000 Subject: [PATCH] Prevent error being thrown so that we can throw our own better one --- src/stores/room-list/algorithms/Algorithm.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 25059aabe7..f709fc3ccb 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -211,7 +211,7 @@ export class Algorithm extends EventEmitter { } // When we do have a room though, we expect to be able to find it - let tag = this.roomIdsToTags[val.roomId][0]; + let tag = this.roomIdsToTags[val.roomId]?.[0]; if (!tag) throw new Error(`${val.roomId} does not belong to a tag and cannot be sticky`); // We specifically do NOT use the ordered rooms set as it contains the sticky room, which