pinballmap / pbm-android

Android Application for pinballmap.com
http://pinballmap.com
9 stars 4 forks source link

If you click Change Region before region is fully loaded, app crashes #174

Closed RyanTG closed 6 years ago

RyanTG commented 6 years ago
12-04 22:24:49.125 14542-14635/com.pbm E/AndroidRuntime: FATAL EXCEPTION: Thread-5
          Process: com.pbm, PID: 14542
          java.lang.NullPointerException: Attempt to invoke virtual method 'int com.pbm.Region.getId()' on a null object reference
          at com.pbm.PBMApplication.initializeRegionMachines(PBMApplication.java:781)
          at com.pbm.InitializeData$1.execute(InitializeData.java:27)
          at com.pbm.BackgroundInitializer.runMethod(BackgroundInitializer.java:7)
          at com.pbm.BackgroundInitializer.run(BackgroundInitializer.java:12)

EDIT:

Steps:

scottwainstock commented 6 years ago

https://github.com/scottwainstock/pbm-android/commit/784d01d458d3a98671e36f5210e84bae194512cf

RyanTG commented 6 years ago

Re-opening this since it's still happening, in a way.

To reproduce:

Result: Crash.

The original issue was that the app crashed right after you clicked "Change Region." But now it crashes when you pick a region. Possibly notable is that even though the app crashes, I can still see the region I just picked show up (behind the "the app crashed" dialog).

scottwainstock commented 6 years ago

https://github.com/scottwainstock/pbm-android/commit/baf8416b7206afb94147a9d1013414e3b34e8924

@RyanTG Not totally wild about this solution... but what do you think? It pops up a message and asks you to try again momentarily. If you wait until the data loads in the background, you are then allowed to change regions.

RyanTG commented 6 years ago

I'm cool with this.