File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -351,27 +351,29 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result
351
351
RTCIceCandidate* candidate = [[RTCIceCandidate alloc ] initWithSdp: sdp sdpMLineIndex: sdpMLineIndex sdpMid: sdpMid];
352
352
RTCPeerConnection *peerConnection = self.peerConnections [peerConnectionId];
353
353
354
- if (peerConnection)
355
- {
354
+ if (peerConnection) {
356
355
[self peerConnectionAddICECandidate: candidate peerConnection: peerConnection result: result];
357
- }else {
356
+ } else {
358
357
result ([FlutterError errorWithCode: [NSString stringWithFormat: @" %@ Failed" ,call.method]
359
358
message: [NSString stringWithFormat: @" Error: peerConnection not found!" ]
360
359
details: nil ]);
361
360
}
362
361
} else if ([@" getStats" isEqualToString: call.method]) {
363
362
NSDictionary * argsMap = call.arguments ;
364
363
NSString * peerConnectionId = argsMap[@" peerConnectionId" ];
365
- NSString * trackId = argsMap[@" trackId" ];
364
+ id trackId = argsMap[@" trackId" ];
366
365
RTCPeerConnection *peerConnection = self.peerConnections [peerConnectionId];
367
366
if (peerConnection) {
368
- if (trackId != nil ) {
367
+ if (trackId != nil && trackId != [ NSNull null ] ) {
369
368
return [self peerConnectionGetStatsForTrackId: trackId peerConnection: peerConnection result: result];
370
369
} else {
371
370
return [self peerConnectionGetStats: peerConnection result: result];
372
371
}
372
+ } else {
373
+ result ([FlutterError errorWithCode: [NSString stringWithFormat: @" %@ Failed" ,call.method]
374
+ message: [NSString stringWithFormat: @" Error: peerConnection not found!" ]
375
+ details: nil ]);
373
376
}
374
- result (nil );
375
377
} else if ([@" createDataChannel" isEqualToString: call.method]){
376
378
NSDictionary * argsMap = call.arguments ;
377
379
NSString * peerConnectionId = argsMap[@" peerConnectionId" ];
You can’t perform that action at this time.
0 commit comments