When a data channel fails to be created, return nil instead of crashing.

BUG=webrtc:4619

Review-Url: https://codereview.webrtc.org/2860353002
Cr-Commit-Position: refs/heads/master@{#18034}
This commit is contained in:
deadbeef
2017-05-05 10:00:18 -07:00
committed by Commit bot
parent a780cab3a5
commit 299c8e0161

View File

@ -25,6 +25,9 @@
rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
self.nativePeerConnection->CreateDataChannel(labelString,
&nativeInit);
if (!dataChannel) {
return nil;
}
return [[RTCDataChannel alloc] initWithNativeDataChannel:dataChannel];
}