woheller69 / omweather

GNU General Public License v3.0
334 stars 14 forks source link

Crash when returning from the rain viewer animation #91

Open opk12 opened 3 weeks ago

opk12 commented 3 weeks ago

Describe the bug When I return Back while the RainViewer animation is playing, the app crashes.

How to Reproduce Steps to reproduce the behavior:

  1. Open the app.
  2. Tap the map icon at the top right, to open the RainViewer map.
  3. Press Play.
  4. Press the Back button at the top left.
FATAL EXCEPTION: main
Process: org.woheller69.omweather, PID: 15985
java.lang.NullPointerException: Attempt to invoke virtual method 'org.osmdroid.views.MapViewRepository org.osmdroid.views.MapView.getRepository()' on a null object reference
    at org.osmdroid.views.overlay.infowindow.InfoWindow.<init>(InfoWindow.java:53)
    at org.osmdroid.views.overlay.infowindow.BasicInfoWindow.<init>(BasicInfoWindow.java:54)
    at org.osmdroid.views.overlay.infowindow.MarkerInfoWindow.<init>(MarkerInfoWindow.java:41)
    at org.osmdroid.views.MapViewRepository.getDefaultMarkerInfoWindow(MapViewRepository.java:55)
    at org.osmdroid.views.overlay.Marker.<init>(Marker.java:116)
    at org.osmdroid.views.overlay.Marker.<init>(Marker.java:93)
    at org.woheller69.weather.activities.RainViewerActivity.replaceLayer(RainViewerActivity.java:320)
    at org.woheller69.weather.activities.RainViewerActivity.showFrame(RainViewerActivity.java:255)
    at org.woheller69.weather.activities.RainViewerActivity$1.lambda$run$0$org-woheller69-weather-activities-RainViewerActivity$1(RainViewerActivity.java:221)
    at org.woheller69.weather.activities.RainViewerActivity$1$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6816)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)

Expected behavior The app does not crash.

Environment (please complete the following information): Version 2.8 from F-droid on Samsung Android 7.1.

I could not reproduce on another phone with Samsung Android 11.

woheller69 commented 3 weeks ago

Good catch. Will check

woheller69 commented 3 weeks ago

Please try this:

-Uninstall -Remove .zip and install

app-release.apk.zip