aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/GroupPermissionResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/GroupPermissionResource.java')
-rw-r--r--src/org/traccar/api/resource/GroupPermissionResource.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/api/resource/GroupPermissionResource.java b/src/org/traccar/api/resource/GroupPermissionResource.java
index 564a379d2..1fbf37a2b 100644
--- a/src/org/traccar/api/resource/GroupPermissionResource.java
+++ b/src/org/traccar/api/resource/GroupPermissionResource.java
@@ -38,7 +38,9 @@ public class GroupPermissionResource extends BaseResource {
Context.getPermissionsManager().checkAdmin(getUserId());
Context.getDataManager().linkGroup(entity.getUserId(), entity.getGroupId());
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
return Response.ok(entity).build();
}
@@ -47,7 +49,9 @@ public class GroupPermissionResource extends BaseResource {
Context.getPermissionsManager().checkAdmin(getUserId());
Context.getDataManager().unlinkGroup(entity.getUserId(), entity.getGroupId());
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
return Response.noContent().build();
}