aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/DevicePermissionResource.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-06-26 00:51:33 +0500
committerAbyss777 <abyss@fox5.ru>2016-06-26 00:51:33 +0500
commita25e7bd56c128fb2a1c673abf735b3e64706f9a8 (patch)
treea99d2cde526f97082d7bc95531772b6835064fcd /src/org/traccar/api/resource/DevicePermissionResource.java
parent67f46c80d3b5e34440a2644f52b81dddfbaba5fa (diff)
downloadtrackermap-server-a25e7bd56c128fb2a1c673abf735b3e64706f9a8.tar.gz
trackermap-server-a25e7bd56c128fb2a1c673abf735b3e64706f9a8.tar.bz2
trackermap-server-a25e7bd56c128fb2a1c673abf735b3e64706f9a8.zip
Added notifications via email
Added notifications settings
Diffstat (limited to 'src/org/traccar/api/resource/DevicePermissionResource.java')
-rw-r--r--src/org/traccar/api/resource/DevicePermissionResource.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/api/resource/DevicePermissionResource.java b/src/org/traccar/api/resource/DevicePermissionResource.java
index 2ef436f11..7de050074 100644
--- a/src/org/traccar/api/resource/DevicePermissionResource.java
+++ b/src/org/traccar/api/resource/DevicePermissionResource.java
@@ -38,7 +38,9 @@ public class DevicePermissionResource extends BaseResource {
Context.getPermissionsManager().checkAdmin(getUserId());
Context.getDataManager().linkDevice(entity.getUserId(), entity.getDeviceId());
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
return Response.ok(entity).build();
}
@@ -47,7 +49,9 @@ public class DevicePermissionResource extends BaseResource {
Context.getPermissionsManager().checkAdmin(getUserId());
Context.getDataManager().unlinkDevice(entity.getUserId(), entity.getDeviceId());
Context.getPermissionsManager().refresh();
- Context.getGeofenceManager().refresh();
+ if (Context.getGeofenceManager() != null) {
+ Context.getGeofenceManager().refresh();
+ }
return Response.noContent().build();
}