8000 fix #512,close #513. · next-coder/flutter-webrtc@a38c858 · GitHub
[go: up one dir, main page]

Skip to content

Commit a38c858

Browse files
committed
1 parent af0993d commit a38c858

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

common/darwin/Classes/FlutterWebRTCPlugin.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,12 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result
628628
return;
629629
}
630630
RTCRtpSender* sender = [peerConnection addTrack:track streamIds:streamIds];
631+
if(sender == nil) {
632+
result([FlutterError errorWithCode:[NSString stringWithFormat:@"%@Failed",call.method]
633+
message:[NSString stringWithFormat:@"Error: peerConnection.addTrack failed!"]
634+
details:nil]);
635+
return;
636+
}
631637
result([self rtpSenderToMap:sender]);
632638
} else if ([@"removeTrack" isEqualToString:call.method]){
633639
NSDictionary* argsMap = call.arguments;

0 commit comments

Comments
 (0)
0