aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/UserResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/UserResource.java')
-rw-r--r--src/org/traccar/api/resource/UserResource.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/org/traccar/api/resource/UserResource.java b/src/org/traccar/api/resource/UserResource.java
index 7cc4ed09a..cfe338b56 100644
--- a/src/org/traccar/api/resource/UserResource.java
+++ b/src/org/traccar/api/resource/UserResource.java
@@ -52,7 +52,12 @@ public class UserResource extends BaseResource {
}
Context.getDataManager().addUser(entity);
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
+ if (Context.getNotificationManager() != null) {
+ Context.getNotificationManager().refresh();
+ }
return Response.ok(entity).build();
}
@@ -66,7 +71,12 @@ public class UserResource extends BaseResource {
}
Context.getDataManager().updateUser(entity);
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
+ if (Context.getNotificationManager() != null) {
+ Context.getNotificationManager().refresh();
+ }
return Response.ok(entity).build();
}
@@ -76,7 +86,12 @@ public class UserResource extends BaseResource {
Context.getPermissionsManager().checkUser(getUserId(), id);
Context.getDataManager().removeUser(id);
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
+ if (Context.getNotificationManager() != null) {
+ Context.getNotificationManager().refresh();
+ }
return Response.noContent().build();
}