OpenSeizureDetector / Android_Pebble_SD

The main OpenSeizureDetector Android App, that is published on the Android Play Store.
http://openseizuredetector.org.uk
GNU General Public License v3.0
9 stars 14 forks source link

V4.2.1n - Crash when switching back to old UI #137

Closed jones139 closed 8 months ago

jones139 commented 8 months ago

***** DEVICE INFO Brand: samsung Device: a20e Model: SM-A202F Manufacturer: samsung Product: a20eeea SDK: 30 Release: 11

***** APP INFO Version: 4.2.1n Installed On: 2024-01-25 20:19:29 Updated On: 2024-01-25 21:10:21 Current Date: 2024-01-27 20:10:05

***** ERROR LOG java.lang.NullPointerException: Attempt to read from field 'java.lang.String uk.org.openseizuredetector.SdServer.mSdDataSourceName' on a null object reference at uk.org.openseizuredetector.FragmentCommon.updateUi(FragmentCommon.java:206) at uk.org.openseizuredetector.FragmentOsdBaseClass$2.run(FragmentOsdBaseClass.java:114) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8653) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

jones139 commented 8 months ago

I had de-selected the 'Use new UI' setting, so the server had re-started. Then pressed the back button to get back to the main activity, when it crashed.

Is the fragment pause/resume life cycle wrong, or was it a timing issue that it had not re-connected to the server quickly enough?

So need to check the lifecycle, and add a check that mConnection is not null before using it.

jones139 commented 8 months ago

It does not seem to be easily reproducible, so probably a race condition?

jones139 commented 8 months ago

Fixed in V4.2.1p