webrtc-interface icon indicating copy to clipboard operation
webrtc-interface copied to clipboard

null handel in RTCRtpCapabilities class

Open dineshnaikb opened this issue 1 year ago • 0 comments

I/org.webrtc.Logging(19097): SurfaceTextureHelper: Setting listener to org.webrtc.Camera2Session$CaptureSessionCallback$$ExternalSyntheticLambda0@aec2ced
E/flutter (19097): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method 'forEach' was called on null.
E/flutter (19097): Receiver: null
E/flutter (19097): Tried calling: forEach(Closure: (dynamic) => Null)
E/flutter (19097): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
E/flutter (19097): #1      new RTCRtpCapabilities.fromMap (package:webrtc_interface/src/rtc_rtp_capabilities.dart:57:22)

codecs headerExtensions fecMechanisms: null

    var fecMechanisms = <String>[];
    dynamic fecMechanismsMap = map['fecMechanisms'];
    fecMechanismsMap.forEach((params) {
      fecMechanisms.add(params);
    });
dynamic fecMechanismsMap = map['fecMechanisms'];

if (fecMechanismsMap != null) {
  fecMechanismsMap.forEach((params) {
    fecMechanisms.add(params);
  });
} else {
  // Handle the case when fecMechanismsMap is null
  print('fecMechanismsMap is null');
}

dineshnaikb avatar Feb 13 '24 08:02 dineshnaikb