aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/resource/GeofenceResource.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/api/resource/GeofenceResource.java b/src/org/traccar/api/resource/GeofenceResource.java
index 5f085023a..d5acf106a 100644
--- a/src/org/traccar/api/resource/GeofenceResource.java
+++ b/src/org/traccar/api/resource/GeofenceResource.java
@@ -52,20 +52,20 @@ public class GeofenceResource extends BaseResource {
geofenceManager.refreshGeofences();
}
- Set<Long> result;
+ Set<Long> result = new HashSet<>();
if (all) {
if (Context.getPermissionsManager().isAdmin(getUserId())) {
- result = new HashSet<>(geofenceManager.getAllGeofencesIds());
+ result.addAll(geofenceManager.getAllGeofencesIds());
} else {
Context.getPermissionsManager().checkManager(getUserId());
- result = new HashSet<>(geofenceManager.getManagedGeofencesIds(getUserId()));
+ result.addAll(geofenceManager.getManagedGeofencesIds(getUserId()));
}
} else {
if (userId == 0) {
userId = getUserId();
}
Context.getPermissionsManager().checkUser(getUserId(), userId);
- result = new HashSet<>(geofenceManager.getUserGeofencesIds(userId));
+ result.addAll(geofenceManager.getUserGeofencesIds(userId));
}
if (groupId != 0) {