transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.64k stars 425 forks source link

App is crashing - NullPointerException com.transistorsoft.locationmanager.location.TSLocation in applyExtras #2180

Open jakub-oone opened 2 days ago

jakub-oone commented 2 days ago

Hello Chris,

we got another error "Attempt to invoke virtual method 'android.os.Bundle android.location.Location.getExtras()' on a null object reference"

Stack trace: NullPointerException Attempt to invoke virtual method 'android.os.Bundle android.location.Location.getExtras()' on a null object reference

com.transistorsoft.locationmanager.location.TSLocation in applyExtras at line 3 com.transistorsoft.locationmanager.service.PolygonGeofencingService in handleGeofencingEvent at line 161 com.transistorsoft.locationmanager.service.PolygonGeofencingService in a at line 3 com.transistorsoft.locationmanager.service.PolygonGeofencingService in $r8$lambda$eNqDkhVR6WpqX_AicdiLstvearQ com.transistorsoft.locationmanager.service.PolygonGeofencingService$$ExternalSyntheticLambda2 in run at line 6 java.util.concurrent.ThreadPoolExecutor in runWorker at line 1145 java.util.concurrent.ThreadPoolExecutor$Worker in run at line 644 java.lang.Thread in run at line 1012

Could you please look at that?

Your Environment

Expected Behavior

App is not crashing

Actual Behavior

App is crashing

Steps to Reproduce

  1. Add some geofences to BackgroundGeolocation.addGeofences(geofences)
  2. Start monitore polygone
  3. App crash after some time (randomly)

Context

Debug logs

Logs ``` PASTE_YOUR_LOGS_HERE ```
christocracy commented 2 days ago

It seems you somehow managed to fire a polygon geofence event but a location failed to be received. This shouldn't be possible.

Are you doing anything interesting while testing this?