aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-11 22:59:59 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-11 22:59:59 +1200
commit063ca2ff893a3db3977a42ea960787b067c549db (patch)
tree59fe49158c4effb3ef2a4910bcbfe9655f7a2d03 /src
parent2cc6f2e4b4610ddc5aafd8b043ff86a86d57cc29 (diff)
downloadtrackermap-server-063ca2ff893a3db3977a42ea960787b067c549db.tar.gz
trackermap-server-063ca2ff893a3db3977a42ea960787b067c549db.tar.bz2
trackermap-server-063ca2ff893a3db3977a42ea960787b067c549db.zip
Check if geofence exists
Diffstat (limited to 'src')
-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 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);
}