aboutsummaryrefslogtreecommitdiff
path: root/sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm
diff options
context:
space:
mode:
Diffstat (limited to 'sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm')
-rw-r--r--sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm8
1 files changed, 3 insertions, 5 deletions
diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm b/sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm
index 1ded45d670..cb75f061d8 100644
--- a/sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm
+++ b/sdk/objc/api/peerconnection/RTCPeerConnection+DataChannel.mm
@@ -23,14 +23,12 @@
std::string labelString = [NSString stdStringForString:label];
const webrtc::DataChannelInit nativeInit =
configuration.nativeDataChannelInit;
- rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
- self.nativePeerConnection->CreateDataChannel(labelString,
- &nativeInit);
- if (!dataChannel) {
+ auto result = self.nativePeerConnection->CreateDataChannelOrError(labelString, &nativeInit);
+ if (!result.ok()) {
return nil;
}
return [[RTC_OBJC_TYPE(RTCDataChannel) alloc] initWithFactory:self.factory
- nativeDataChannel:dataChannel];
+ nativeDataChannel:result.MoveValue()];
}
@end