aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/database/GeofenceManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/database/GeofenceManager.java b/src/org/traccar/database/GeofenceManager.java
index 4c5c28768..32c9e2368 100644
--- a/src/org/traccar/database/GeofenceManager.java
+++ b/src/org/traccar/database/GeofenceManager.java
@@ -193,7 +193,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);
}