From d9a13f006cf8af61e186525cdd9432d2a64236b9 Mon Sep 17 00:00:00 2001 From: sergystepanov Date: Thu, 4 Jun 2026 23:11:45 +0300 Subject: [PATCH] Disable renegotiation when ICE fails --- web/js/network/webrtc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/js/network/webrtc.js b/web/js/network/webrtc.js index f18b6776..b1fcde1a 100755 --- a/web/js/network/webrtc.js +++ b/web/js/network/webrtc.js @@ -203,6 +203,8 @@ export const webrtc = { ) => { log.debug("[rtc] [sdp] remote SDP", sdp); + if (!pc) return; + try { await pc.setRemoteDescription(new RTCSessionDescription(sdp)); } catch (e) { @@ -230,6 +232,8 @@ export const webrtc = { addCandidate: ( /** @type {RTCLocalIceCandidateInit | string} */ candidate, ) => { + if (!pc) return; + if (hasRemoteDescription()) { addRemoteCandidate(candidate); } else {