You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual Behaviour
The app crashes if the app was connected to the PSLab via WiFi, PSLab is turned off and app is closed.
Expected Behaviour
The app should never crash.
Steps to reproduce it
0. Power on PSLab with ESP01
Connect app to PSLab via WiFi
Power off PSLab
Wait until phone notices that WiFi is offline and app shows disconnect message
Close app
---> Crash
FATAL EXCEPTION: main
Process: io.pslab, PID: 16813
java.lang.RuntimeException: Unable to destroy activity {io.pslab/io.pslab.activity.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.pslab.communication.CommunicationHandler.close()' on a null object reference
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4244)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4262)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1551)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.pslab.communication.CommunicationHandler.close()' on a null object reference
at io.pslab.communication.ScienceLab.disconnect(ScienceLab.java:2910)
at io.pslab.activity.MainActivity.onDestroy(MainActivity.java:520)
at android.app.Activity.performDestroy(Activity.java:6889)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1175)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4231)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4262)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1551)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Uh oh!
There was an error while loading. Please reload this page.
Actual Behaviour
The app crashes if the app was connected to the PSLab via WiFi, PSLab is turned off and app is closed.
Expected Behaviour
The app should never crash.
Steps to reproduce it
0. Power on PSLab with ESP01
---> Crash
Screenshots of the issue
Video: https://github.com/user-attachments/assets/99412b60-40d6-461a-a9aa-4dc043c279ab
Would you like to work on the issue?
Yes, I will open a PR in a short time.
The text was updated successfully, but these errors were encountered: