From b968852456abba89cc1ec55fc467858f91c9b319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Jim=C3=A9nez=20Moreno?= Date: Thu, 18 Jun 2020 10:38:45 +0200 Subject: [PATCH] Do not register data channel twice --- components/script/dom/rtcpeerconnection.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/script/dom/rtcpeerconnection.rs b/components/script/dom/rtcpeerconnection.rs index 348fef252564..c92233b59bff 100644 --- a/components/script/dom/rtcpeerconnection.rs +++ b/components/script/dom/rtcpeerconnection.rs @@ -301,8 +301,6 @@ impl RTCPeerConnection { Some(channel_id), ); - self.register_data_channel(channel_id, &channel); - let event = RTCDataChannelEvent::new( &self.global(), atom!("datachannel"), @@ -334,9 +332,9 @@ impl RTCPeerConnection { .data_channels .borrow_mut() .insert(id, Dom::from_ref(channel)) - .is_none() + .is_some() { - debug_assert!(false, "Could not register data channel"); + debug_assert!(false, "Data channel already registered"); } }