Index: webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
index 3b7632c2b90eb1a73405c5cf64e34d485718d3ff..57c678032a19be0c489a9fad4a00895f9efdbd25 100644 |
--- a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
+++ b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm |
@@ -197,14 +197,16 @@ void PeerConnectionDelegateAdapter::OnIceCandidate( |
constraints:(RTCMediaConstraints *)constraints |
delegate:(id<RTCPeerConnectionDelegate>)delegate { |
NSParameterAssert(factory); |
+ std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config( |
+ configuration.nativeConfiguration); |
+ if (!config) |
+ return nullptr; |
tkchin_webrtc
2016/05/13 17:48:06
ObjC style requires braces
nil not nullptr.
if (
hbos
2016/05/16 12:49:05
Done.
|
if (self = [super init]) { |
_observer.reset(new webrtc::PeerConnectionDelegateAdapter(self)); |
- webrtc::PeerConnectionInterface::RTCConfiguration config = |
- configuration.nativeConfiguration; |
std::unique_ptr<webrtc::MediaConstraints> nativeConstraints = |
constraints.nativeConstraints; |
_peerConnection = |
- factory.nativeFactory->CreatePeerConnection(config, |
+ factory.nativeFactory->CreatePeerConnection(*config, |
nativeConstraints.get(), |
nullptr, |
nullptr, |
@@ -251,7 +253,11 @@ void PeerConnectionDelegateAdapter::OnIceCandidate( |
} |
- (BOOL)setConfiguration:(RTCConfiguration *)configuration { |
- return _peerConnection->SetConfiguration(configuration.nativeConfiguration); |
+ std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config( |
+ configuration.nativeConfiguration); |
+ if (!config) |
+ return false; |
tkchin_webrtc
2016/05/13 17:48:06
BOOL is not a boolean
if (!nativeConfiguration) {
hbos
2016/05/16 12:49:05
Done.
|
+ return _peerConnection->SetConfiguration(*config); |
} |
- (void)close { |