Fix CallPreview `room is null` (#7265) (#7348)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
David Baker 2021-12-13 14:59:36 +00:00 committed by GitHub
parent b54a6d570e
commit 2ceed006aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -133,7 +133,9 @@ export default class CallPreview extends React.Component<IProps, IState> {
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 = () => {