microg / IchnaeaNlpBackend

Backend for UnifiedNlp that uses Mozilla Location Service for geolocation.
119 stars 28 forks source link

Fix possible NPE #63

Closed jonathanklee closed 2 years ago

jonathanklee commented 2 years ago

A NPE was reported here: https://gitlab.e.foundation/e/backlog/-/issues/5676#note_286210

ale5000-git commented 2 years ago

Hi, the link return error 404.

jonathanklee commented 2 years ago

Here is the backtrace:

00-07 18:51:42.345  5826  5826 W IchnaeaBackendService: java.lang.NullPointerException: Attempt to invoke virtual method 'float android.location.Location.getAccuracy()' on a null object reference
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at org.microg.nlp.backend.ichnaea.BackendService.startCalculate(BackendService.java:211)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at org.microg.nlp.backend.ichnaea.BackendService.onWiFisChanged(BackendService.java:163)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at org.microg.nlp.api.WiFiBackendHelper.onWiFisChanged(WiFiBackendHelper.java:109)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at org.microg.nlp.api.WiFiBackendHelper.access$000(WiFiBackendHelper.java:32)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at org.microg.nlp.api.WiFiBackendHelper$1.onReceive(WiFiBackendHelper.java:42)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1580)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at android.os.Handler.handleCallback(Handler.java:938)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at android.os.Handler.dispatchMessage(Handler.java:99)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at android.os.Looper.loop(Looper.java:223)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at android.app.ActivityThread.main(ActivityThread.java:7664)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at java.lang.reflect.Method.invoke(Native Method)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
10-07 18:51:42.345  5826  5826 W IchnaeaBackendService:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
jonathanklee commented 2 years ago

@ale5000-git No follow up on this ?

ale5000-git commented 2 years ago

This is simple so there isn't so much to comment, we just have to wait that mar-v-in has some time to merge things. He mostly lack time.