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:
@ -25,6 +25,9 @@
|
|||||||
rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
|
rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
|
||||||
self.nativePeerConnection->CreateDataChannel(labelString,
|
self.nativePeerConnection->CreateDataChannel(labelString,
|
||||||
&nativeInit);
|
&nativeInit);
|
||||||
|
if (!dataChannel) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
return [[RTCDataChannel alloc] initWithNativeDataChannel:dataChannel];
|
return [[RTCDataChannel alloc] initWithNativeDataChannel:dataChannel];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user