[FIX] discuss: prevent peer-to-peer update without a RTCPeerConnection

Before this commit, it was possible that an attempt to update
peer connections made right at the moment the connection was swapped
from peer-to-peer to server mode. Which would cause a traceback.

This commit fixes this issue by checking if there is a
`RTCPeerConnection` before trying to update it.

closes odoo/odoo#148505

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
TSO
2024-01-10 06:12:24 +00:00
parent 9eb2cb736b
commit 09e1040cd1
@@ -1494,6 +1494,9 @@ export class Rtc {
* negotiationneeded -> offer -> answer -> ...
*/
async updateRemote(session, trackKind) {
if (!session.peerConnection) {
return;
}
this.log(session, `updating ${trackKind} transceiver`);
let track;
switch (trackKind) {