Bug 1503023 - After waiting for certs make sure the PeerConnection still exists r=jib
authorNico Grunbaum <na-g@nostrum.com>
Mon, 29 Oct 2018 22:57:10 +0000
changeset 502671 109edc69784186ee31151b6aeae300f0b1325ef5
parent 502670 c2e7a489d786836b8eca383786f97d5ffa3f1730
child 502672 4ed8b1a5fee1d559a94d51028f28f0951f697fe3
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1503023
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1503023 - After waiting for certs make sure the PeerConnection still exists r=jib Ensure that a PeerConnection is still open before setting the certificates. Differential Revision: https://phabricator.services.mozilla.com/D10122
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -576,17 +576,20 @@ class RTCPeerConnection {
       }
     }
 
     if (!certificate) {
       certificate = await this._win.RTCPeerConnection.generateCertificate({
         name: "ECDSA", namedCurve: "P-256",
       });
     }
-    this._impl.certificate = certificate;
+    // Is the PC still around after the await?
+    if (!this._closed) {
+      this._impl.certificate = certificate;
+    }
   }
 
   _resetPeerIdentityPromise() {
     this._peerIdentity = new this._win.Promise((resolve, reject) => {
       this._resolvePeerIdentity = resolve;
       this._rejectPeerIdentity = reject;
     });
   }