Ignore null ice candidates

Ignore null ice candidate
This commit is contained in:
Tom Sightler
2024-09-25 22:22:55 -04:00
parent 800fb32ef4
commit 519d26d61e

View File

@@ -83,16 +83,18 @@ export class WebrtcConnection extends Subscribed {
}),
this.pc.onIceCandidate.subscribe(async (iceCandidate) => {
await firstValueFrom(this.onOfferSent)
this.sendMessage({
body: {
doorbot_id: camera.id,
ice: iceCandidate.candidate,
mlineindex: iceCandidate.sdpMLineIndex,
},
dialog_id: this.dialogId,
method: 'ice',
})
if (iceCandidate?.candidate) {
await firstValueFrom(this.onOfferSent)
this.sendMessage({
body: {
doorbot_id: camera.id,
ice: iceCandidate.candidate,
mlineindex: iceCandidate.sdpMLineIndex,
},
dialog_id: this.dialogId,
method: 'ice',
})
}
})
)
}