From 2ceed006aab95fed4d9169ef6dc83f339500e16a Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 13 Dec 2021 14:59:36 +0000 Subject: [PATCH] Fix CallPreview `room is null` (#7265) (#7348) Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/voip/CallPreview.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/voip/CallPreview.tsx b/src/components/views/voip/CallPreview.tsx index 1c667e4229..79a7d8c0e1 100644 --- a/src/components/views/voip/CallPreview.tsx +++ b/src/components/views/voip/CallPreview.tsx @@ -133,7 +133,9 @@ export default class CallPreview extends React.Component { dis.unregister(this.dispatcherRef); SettingsStore.unwatchSetting(this.settingsWatcherRef); const room = MatrixClientPeg.get().getRoom(this.state.roomId); - WidgetLayoutStore.instance.off(WidgetLayoutStore.emissionForRoom(room), this.updateCalls); + if (room) { + WidgetLayoutStore.instance.off(WidgetLayoutStore.emissionForRoom(room), this.updateCalls); + } } private onRoomViewStoreUpdate = () => {