aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api/security
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-16 08:02:56 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-16 08:02:56 -0700
commit74d73a9dc28fc608117c04da4652d43f633a72c5 (patch)
treef1f9c24c8321bdec01ff1d42b51aebede6c4b9d1 /src/main/java/org/traccar/api/security
parent007b4007e063cfb966a4024ef267992a4f1f9ccb (diff)
downloadtrackermap-server-74d73a9dc28fc608117c04da4652d43f633a72c5.tar.gz
trackermap-server-74d73a9dc28fc608117c04da4652d43f633a72c5.tar.bz2
trackermap-server-74d73a9dc28fc608117c04da4652d43f633a72c5.zip
Improve user check
Diffstat (limited to 'src/main/java/org/traccar/api/security')
-rw-r--r--src/main/java/org/traccar/api/security/PermissionsService.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/api/security/PermissionsService.java b/src/main/java/org/traccar/api/security/PermissionsService.java
index 38bf48f30..7f5a46225 100644
--- a/src/main/java/org/traccar/api/security/PermissionsService.java
+++ b/src/main/java/org/traccar/api/security/PermissionsService.java
@@ -181,7 +181,7 @@ public class PermissionsService {
|| before.getUserLimit() != after.getUserLimit()) {
checkAdmin(userId);
}
- User user = getUser(userId);
+ User user = userId > 0 ? getUser(userId) : null;
if (user != null && user.getExpirationTime() != null
&& !Objects.equals(before.getExpirationTime(), after.getExpirationTime())
&& (after.getExpirationTime() == null