Better null check

to make tests happy
This commit is contained in:
David Baker 2020-12-15 18:01:42 +00:00
parent a798772e80
commit a77d675664

View file

@ -118,7 +118,7 @@ function getRemoteAudioElement(): HTMLAudioElement {
export default class CallHandler {
private calls = new Map<string, MatrixCall>(); // roomId -> call
private audioPromises = new Map<AudioID, Promise<void>>();
private dispatcherRef: string;
private dispatcherRef: string = null;
static sharedInstance() {
if (!window.mxCallHandler) {
@ -152,7 +152,7 @@ export default class CallHandler {
if (cli) {
cli.removeListener('Call.incoming', this.onCallIncoming);
}
if (this.dispatcherRef) dis.unregister(this.dispatcherRef);
if (this.dispatcherRef !== null) dis.unregister(this.dispatcherRef);
}
private onCallIncoming = (call) => {