Prevent error being thrown so that we can throw our own better one

This commit is contained in:
Michael Telatynski 2021-02-18 18:06:26 +00:00
parent 50252483c6
commit 8fc244452c

View file

@ -211,7 +211,7 @@ export class Algorithm extends EventEmitter {
} }
// When we do have a room though, we expect to be able to find it // 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`); 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 // We specifically do NOT use the ordered rooms set as it contains the sticky room, which