Hello,
Firebase' Crashlytics reports very seldom a NullPointerException in the
getWorldCenter of the X2 library.
The code in the Game_Tick Event is extremly unspectacular:
...
Dim v As B2Vec2 = Ball1.Body.WorldCenter.CreateCopy
X2.UpdateWorldCenter(v)
...
How does one can avoid (= test before) if a bad vector v is given to that sub?
A simple "Try ... Catch ... End Try"-Structure will not help since the structure is basically correct.
Here the CrashReport:
Caused by java.lang.NullPointerException
at anywheresoftware.b4a.objects.B2Body.getWorldCenter(B2Body.java:46)
at twinnypoints.gg.goilsoft.de.game._tick(game.java:3162)
at twinnypoints.gg.goilsoft.de.x2utils$ResumableSub_MainLoop.resume(x2utils.java:856)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1690)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5590)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java)