From cb4b23dbf6c937340e8825769e4cc72fc52c8692 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 2 Dec 2021 14:07:27 +0000 Subject: [PATCH] Fix CallPreview `room is null` (#7265) --- 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 1c667e42291..79a7d8c0e14 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 = () => {