diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/database/GeofenceManager.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/database/GeofenceManager.java b/src/org/traccar/database/GeofenceManager.java index d3cf2ad1f..e1eb042c8 100644 --- a/src/org/traccar/database/GeofenceManager.java +++ b/src/org/traccar/database/GeofenceManager.java @@ -153,7 +153,8 @@ public class GeofenceManager { Position lastPosition = Context.getConnectionManager().getLastPosition(device.getId()); if (lastPosition != null && deviceGeofencesWithGroups.containsKey(device.getId())) { for (Long geofenceId : deviceGeofencesWithGroups.get(device.getId())) { - if (getGeofence(geofenceId).getGeometry() + Geofence geofence = getGeofence(geofenceId); + if (geofence != null && geofence.getGeometry() .containsPoint(lastPosition.getLatitude(), lastPosition.getLongitude())) { deviceGeofenceIds.add(geofenceId); } |