Skip to content

Commit

Permalink
Use same reference so non-null inference can happen
Browse files Browse the repository at this point in the history
  • Loading branch information
MadLittleMods committed Nov 8, 2022
1 parent 3670183 commit 4c49e68
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/webrtc/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,11 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
this.invitee = opts.invitee;
this.client = opts.client;

if (!this.client.getDeviceId()) throw new Error("Client must have a device ID to start calls");
const deviceId = this.client.getDeviceId();
if (!deviceId) throw new Error("Client must have a device ID to start calls");

this.forceTURN = opts.forceTURN ?? false;
this.ourPartyId = this.client.deviceId!;
if (!this.ourPartyId) {
logger.warn('MatrixCall: ourPartyId is null which may have unintended consequences');
}
this.ourPartyId = deviceId;
this.opponentDeviceId = opts.opponentDeviceId;
this.opponentSessionId = opts.opponentSessionId;
this.groupCallId = opts.groupCallId;
Expand Down

0 comments on commit 4c49e68

Please sign in to comment.