Do not register data channel twice

This commit is contained in:
Fernando Jiménez Moreno 2020-06-18 10:38:45 +02:00
parent a6a00d5e65
commit b968852456

View file

@ -301,8 +301,6 @@ impl RTCPeerConnection {
Some(channel_id), Some(channel_id),
); );
self.register_data_channel(channel_id, &channel);
let event = RTCDataChannelEvent::new( let event = RTCDataChannelEvent::new(
&self.global(), &self.global(),
atom!("datachannel"), atom!("datachannel"),
@ -334,9 +332,9 @@ impl RTCPeerConnection {
.data_channels .data_channels
.borrow_mut() .borrow_mut()
.insert(id, Dom::from_ref(channel)) .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");
} }
} }