Commit 1ad89b32 authored by Michael Froman's avatar Michael Froman
Browse files

Bug 1681025 - don't call GetDtlsTransport on transceiver if RTCRtpReceiver has...

Bug 1681025 - don't call GetDtlsTransport on transceiver if RTCRtpReceiver has been shutdown. r=ng, a=jcristau

Differential Revision: https://phabricator.services.mozilla.com/D100952
parent 29dbc0c8
......@@ -126,6 +126,9 @@ JSObject* RTCRtpReceiver::WrapObject(JSContext* aCx,
}
RTCDtlsTransport* RTCRtpReceiver::GetTransport() const {
if (!mTransceiverImpl) {
return nullptr;
}
return mTransceiverImpl->GetDtlsTransport();
}
......
......@@ -21,6 +21,18 @@ promise_test(async (t)=> {
assert_true(offer.sdp.includes("m=video"), "offer should contain a video m-section");
}, "A transceiver added and stopped before the initial offer generation should not trigger an offer m-section generation");
promise_test(async (t)=> {
const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
pc1.addTransceiver("audio", { direction: "sendonly" });
pc1.addTransceiver("video");
assert_equals(null, pc1.getTransceivers()[1].receiver.transport);
pc1.getTransceivers()[1].stop();
assert_equals(pc1.getTransceivers()[1].receiver.transport, null);
}, "A transceiver added and stopped should not crash when getting receiver's transport");
promise_test(async (t)=> {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment