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() {