From 29b141f8e4aea97c74b74106cda614db953a47e1 Mon Sep 17 00:00:00 2001 From: Nico Grunbaum Date: Mon, 29 Oct 2018 22:57:10 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- dom/media/PeerConnection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 8fb88b4d6d27..962266abb517 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -581,7 +581,10 @@ class RTCPeerConnection { 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() {