1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-14 19:02:33 +03:00

Merge pull request #4796 from matrix-org/travis/room-list/bug/crash-filter

Fix crash when filtering new room list too fast
This commit is contained in:
Travis Ralston
2020-06-18 16:53:42 -06:00
committed by GitHub

View File

@@ -240,6 +240,7 @@ export class ListNotificationState extends EventEmitter implements IDestroyable
this.rooms = rooms;
for (const oldRoom of diff.removed) {
const state = this.states[oldRoom.roomId];
if (!state) continue; // We likely just didn't have a badge (race condition)
delete this.states[oldRoom.roomId];
state.off(NOTIFICATION_STATE_UPDATE, this.onRoomNotificationStateUpdate);
state.destroy();