Return nil from RTCPeerConnectionFactory when creation fails
RTCPeerConnectionFactory.createPeerConnection did not check the return value of the native createPeerConnection() - so when the native PC fails to be created, it could end up attempting to use a null pointer. The change makes it return nil when the creation fails. The application can then detect and respond to the failure. Review-Url: https://codereview.webrtc.org/2240633004 Cr-Commit-Position: refs/heads/master@{#13732}
This commit is contained in:
@ -232,6 +232,9 @@ void PeerConnectionDelegateAdapter::OnIceCandidatesRemoved(
|
||||
nullptr,
|
||||
nullptr,
|
||||
_observer.get());
|
||||
if (!_peerConnection) {
|
||||
return nil;
|
||||
}
|
||||
_localStreams = [[NSMutableArray alloc] init];
|
||||
_delegate = delegate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user