Conform more of the codebase to strictNullChecks (#10731)

This commit is contained in:
Michael Telatynski 2023-04-28 09:45:36 +01:00 committed by GitHub
parent 9f8113eabd
commit 1281c0746b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 147 additions and 119 deletions

View file

@ -152,15 +152,21 @@ export default class LegacyCallEventGrouper extends EventEmitter {
};
public answerCall = (): void => {
LegacyCallHandler.instance.answerCall(this.roomId);
const roomId = this.roomId;
if (!roomId) return;
LegacyCallHandler.instance.answerCall(roomId);
};
public rejectCall = (): void => {
LegacyCallHandler.instance.hangupOrReject(this.roomId, true);
const roomId = this.roomId;
if (!roomId) return;
LegacyCallHandler.instance.hangupOrReject(roomId, true);
};
public callBack = (): void => {
LegacyCallHandler.instance.placeCall(this.roomId, this.isVoice ? CallType.Voice : CallType.Video);
const roomId = this.roomId;
if (!roomId) return;
LegacyCallHandler.instance.placeCall(roomId, this.isVoice ? CallType.Voice : CallType.Video);
};
public toggleSilenced = (): void => {
@ -191,9 +197,10 @@ export default class LegacyCallEventGrouper extends EventEmitter {
};
private setCall = (): void => {
if (this.call) return;
const callId = this.callId;
if (!callId || this.call) return;
this.call = LegacyCallHandler.instance.getCallById(this.callId);
this.call = LegacyCallHandler.instance.getCallById(callId);
this.setCallListeners();
this.setState();
};