From 0fa8605640013d97ef780ada1810f68b69ff2fbf Mon Sep 17 00:00:00 2001 From: Qingsi Wang Date: Thu, 9 May 2019 10:37:26 -0700 Subject: [PATCH] Add DCHECK on the port allocator in P2PTransportChannel. Methods of P2PTransportChannel have been assuming a non-null port allocator for a long time, and yet the constructor does not check for that. With the recent change that wires a signal in the port allocator to the transport in the constructor, a valid allocator becomes a must. Bug: None Change-Id: I4ec2e5b577d74a598ee3c2f8ad59e9f0285ac4b9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135880 Reviewed-by: Steve Anton Commit-Queue: Qingsi Wang Cr-Commit-Position: refs/heads/master@{#27897} --- p2p/base/p2p_transport_channel.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc index 1434f9a8f0..2aa1ccb03f 100644 --- a/p2p/base/p2p_transport_channel.cc +++ b/p2p/base/p2p_transport_channel.cc @@ -142,6 +142,7 @@ P2PTransportChannel::P2PTransportChannel( true /* presume_writable_when_fully_relayed */, REGATHER_ON_FAILED_NETWORKS_INTERVAL, RECEIVING_SWITCHING_DELAY) { + RTC_DCHECK(allocator_ != nullptr); weak_ping_interval_ = GetWeakPingIntervalInFieldTrial(); // Validate IceConfig even for mostly built-in constant default values in case // we change them.