File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -574,8 +574,12 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result
574
574
RTCPeerConnection *peerConnection = self.peerConnections [peerConnectionId];
575
575
if (peerConnection) {
576
576
RTCSessionDescription* sdp = peerConnection.localDescription ;
577
- NSString *type = [RTCSessionDescription stringForType: sdp.type];
578
- result (@{@" sdp" : sdp.sdp , @" type" : type});
577
+ if (nil == sdp){
578
+ result (nil );
579
+ }else {
580
+ NSString *type = [RTCSessionDescription stringForType: sdp.type];
581
+ result (@{@" sdp" : sdp.sdp , @" type" : type});
582
+ }
579
583
} else {
580
584
result ([FlutterError errorWithCode: [NSString stringWithFormat: @" %@ Failed" ,call.method]
581
585
message: [NSString stringWithFormat: @" Error: peerConnection not found!" ]
@@ -587,8 +591,12 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result
587
591
RTCPeerConnection *peerConnection = self.peerConnections [peerConnectionId];
588
592
if (peerConnection) {
589
593
RTCSessionDescription* sdp = peerConnection.remoteDescription ;
590
- NSString *type = [RTCSessionDescription stringForType: sdp.type];
591
- result (@{@" sdp" : sdp.sdp , @" type" : type});
594
+ if (nil == sdp){
595
+ result (nil );
596
+ }else {
597
+ NSString *type = [RTCSessionDescription stringForType: sdp.type];
598
+ result (@{@" sdp" : sdp.sdp , @" type" : type});
599
+ }
592
600
} else {
593
601
result ([FlutterError errorWithCode: [NSString stringWithFormat: @" %@ Failed" ,call.method]
594
602
message: [NSString stringWithFormat: @" Error: peerConnection not found!" ]
You can’t perform that action at this time.
0 commit comments