Closed bk138 closed 2 years ago
Still with 2.0.2, it's not a race. May it be https://stackoverflow.com/questions/23148677/service-onstartcommand-throwing-nullpointerexception ? Also see https://github.com/bk138/droidVNC-NG/commit/44765cfc338193fc7cc6e13f1502659cd228b29b :thinking:
One issue might be the data type for intent
parameter: https://github.com/bk138/multivnc/blob/2aa9abe59ffbce9b25c279de517443a9f7f6231e/android/app/src/main/java/com/coboltforge/dontmind/multivnc/VNCConnService.kt#L90
Because Intent
is used instead of Intent?
, Kotlin compiler will automatically insert a null-check here. But intent
parameter can be null for onStartCommand().
One issue might be the data type for
intent
parameter:Because
Intent
is used instead ofIntent?
, Kotlin compiler will automatically insert a null-check here. Butintent
parameter can be null for onStartCommand().
You mean that's the reason it reports line 2 deep from the bowels of Kotlin instead of the line of onStartCommand()?
It might be.
When I do (new VNCConnService()).onStartCommand(null, 0, 0);
from any Java file, resulting exception has line number 2 but the message clearly states which argument is null. Ex:
2021-11-26 19:21:24.638 31624-31672/com.coboltforge.dontmind.multivnc E/AndroidRuntime: FATAL EXCEPTION: Thread-6
Process: com.coboltforge.dontmind.multivnc, PID: 31624
java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter intent
at com.coboltforge.dontmind.multivnc.VNCConnService.onStartCommand(Unknown Source:2)
at com.coboltforge.dontmind.multivnc.VNCConn$ServerToClientThread.run(VNCConn.java:267)
Yeah those details are ommited by the Goog Play stack trace above 🙄
No more reports incoming on Google Play, I rule this issue closed :hammer:
VNCConnService is still racy, sometimes NullpointerExceptions can occur.
Reported backtraces are not really helpful:
Theories