nadar71 / EarthquakeWatchdog

App showing the latest hearthquake event from USGS site.
4 stars 0 forks source link

Crash app, at 1st start of new install or app updated, and in any case where there is no connection #91

Closed nadar71 closed 5 years ago

nadar71 commented 5 years ago

2019-07-22 13:28:25.939 16239-16433/com.indiewalk.watchdog.earthquake E/AndroidRuntime: FATAL EXCEPTION: IntentService[EarthquakeSyncIntentService] Process: com.indiewalk.watchdog.earthquake, PID: 16239 java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference at com.indiewalk.watchdog.earthquake.net.EarthquakeNetworkDataSource.fetchEarthquakeWrapper(EarthquakeNetworkDataSource.java:147) at com.indiewalk.watchdog.earthquake.net.EarthquakeSyncIntentService.onHandleIntent(EarthquakeSyncIntentService.java:21) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:176) at android.os.HandlerThread.run(HandlerThread.java:65)

-> must make a check in connection in initializeData, before arriving to intent that fetchdata, and giving the user a message. Just like in loader used by refresh in main page for checking connection before doing everything, and communicating it to main view