Skip to content

Avoid NullPointerException when addCandidate #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2024
Merged

Conversation

luxi78
Copy link
Contributor

@luxi78 luxi78 commented Jul 29, 2021

Set sdpMid value to an empty string replacing null for avoiding NullPointerException:

W/System.err(10024): java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes(java.lang.String)' on a null object reference
W/System.err(10024): at org.webrtc.JniHelper.getStringBytes(JniHelper.java:25)
W/System.err(10024): at org.webrtc.PeerConnection.nativeAddIceCandidate(Native Method)
W/System.err(10024): at org.webrtc.PeerConnection.addIceCandidate(PeerConnection.java:896)
W/System.err(10024): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.peerConnectionAddICECandidate(MethodCallHandlerImpl.java:1432)
W/System.err(10024): at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:290)
W/System.err(10024): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/System.err(10024): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err(10024): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
W/System.err(10024): at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(10024): at android.os.MessageQueue.next(MessageQueue.java:325)
W/System.err(10024): at android.os.Looper.loop(Looper.java:142)
W/System.err(10024): at android.app.ActivityThread.main(ActivityThread.java:6574)
W/System.err(10024): at java.lang.reflect.Method.invoke(Native Method)
W/System.err(10024): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
W/System.err(10024): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/rtc (10024):
E/rtc (10024):
E/rtc (10024): #
E/rtc (10024): # Fatal error in: gen/sdk/android/generated_metrics_jni/../../../../../../../../usr/local/google/home/sakal/code/webrtc-aar-release/src/sdk/android/src/jni/jni_generator_helper.h, line 94
E/rtc (10024): # last system error: 0
E/rtc (10024): # Check failed: !env->ExceptionCheck()
E/rtc (10024): #
F/libc (10024): Fatal signal 6 (SIGABRT), code -6 in tid 10024 (ple.flutter_prj), pid 10024 (ple.flutter_prj)

Description

Reference issue

Fixes #...

Set sdpMid value to an empty string replacing null for avoiding NullPointerException:

W/System.err(10024): java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes(java.lang.String)' on a null object reference
W/System.err(10024): 	at org.webrtc.JniHelper.getStringBytes(JniHelper.java:25)
W/System.err(10024): 	at org.webrtc.PeerConnection.nativeAddIceCandidate(Native Method)
W/System.err(10024): 	at org.webrtc.PeerConnection.addIceCandidate(PeerConnection.java:896)
W/System.err(10024): 	at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.peerConnectionAddICECandidate(MethodCallHandlerImpl.java:1432)
W/System.err(10024): 	at com.cloudwebrtc.webrtc.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:290)
W/System.err(10024): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
W/System.err(10024): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
W/System.err(10024): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
W/System.err(10024): 	at android.os.MessageQueue.nativePollOnce(Native Method)
W/System.err(10024): 	at android.os.MessageQueue.next(MessageQueue.java:325)
W/System.err(10024): 	at android.os.Looper.loop(Looper.java:142)
W/System.err(10024): 	at android.app.ActivityThread.main(ActivityThread.java:6574)
W/System.err(10024): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err(10024): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
W/System.err(10024): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/rtc     (10024): 
E/rtc     (10024): 
E/rtc     (10024): #
E/rtc     (10024): # Fatal error in: gen/sdk/android/generated_metrics_jni/../../../../../../../../usr/local/google/home/sakal/code/webrtc-aar-release/src/sdk/android/src/jni/jni_generator_helper.h, line 94
E/rtc     (10024): # last system error: 0
E/rtc     (10024): # Check failed: !env->ExceptionCheck()
E/rtc     (10024): # 
F/libc    (10024): Fatal signal 6 (SIGABRT), code -6 in tid 10024 (ple.flutter_prj), pid 10024 (ple.flutter_prj)
Copy link

codecov bot commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (c142fba) to head (365ce1f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #105   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          25      25           
  Lines        2803    2803           
======================================
  Misses       2803    2803           
Flag Coverage Δ
go 0.00% <ø> (ø)
wasm 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sean-Der Sean-Der merged commit bf037f1 into pion:master Oct 26, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants