aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/database/GeofenceManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/org/traccar/database/GeofenceManager.java b/src/org/traccar/database/GeofenceManager.java
index 3f4d4c5ce..cc9f82879 100644
--- a/src/org/traccar/database/GeofenceManager.java
+++ b/src/org/traccar/database/GeofenceManager.java
@@ -150,7 +150,7 @@ public class GeofenceManager {
deviceGeofenceIds.clear();
}
Position lastPosition = Context.getConnectionManager().getLastPosition(device.getId());
- if (lastPosition != null) {
+ if (lastPosition != null && deviceGeofencesWithGroups.containsKey(device.getId())) {
for (Long geofenceId : deviceGeofencesWithGroups.get(device.getId())) {
if (getGeofence(geofenceId).getGeometry()
.containsPoint(lastPosition.getLatitude(), lastPosition.getLongitude())) {