From b14e9238049aa7e14b78b82887a83ab1621d556b Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 31 May 2018 05:04:52 -0700 Subject: [PATCH] webrtc wpt: check signalingState before addIceCandidate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in order to avoid issues with calling addIceCandidate when the peerconnection is closed BUG=836871 Change-Id: I698f5365a4e1b72a812fbc5e3adf5e51586718a6 Reviewed-on: https://chromium-review.googlesource.com/1079550 Commit-Queue: Philipp Hancke Commit-Queue: Henrik Boström Reviewed-by: Henrik Boström Cr-Commit-Position: refs/heads/master@{#563196} --- webrtc/RTCPeerConnection-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/RTCPeerConnection-helper.js b/webrtc/RTCPeerConnection-helper.js index 8ccebbd867f05a..34e0d75903c68d 100644 --- a/webrtc/RTCPeerConnection-helper.js +++ b/webrtc/RTCPeerConnection-helper.js @@ -229,7 +229,7 @@ function exchangeIceCandidates(pc1, pc2) { // There is ongoing discussion on w3c/webrtc-pc#1213 // that there should be an empty candidate string event // for end of candidate for each m= section. - if(candidate) { + if(candidate && remotePc.signalingState !== 'closed') { remotePc.addIceCandidate(candidate); } });