diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/database/DriversManager.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/database/DriversManager.java b/src/org/traccar/database/DriversManager.java index 1744936e3..cba2e14c1 100644 --- a/src/org/traccar/database/DriversManager.java +++ b/src/org/traccar/database/DriversManager.java @@ -214,7 +214,11 @@ public class DriversManager { public final boolean authorizeDriverByUniqueId(String driverUniqueId, long deviceId) { if (driversByUniqueId.containsKey(driverUniqueId)) { long chekingDriverId = getDriverByUniqueId(driverUniqueId).getId(); - for (long driverId : getAllDeviceDrivers(deviceId)) { + Set<Long> deviceDrivers = getAllDeviceDrivers(deviceId); + if (deviceDrivers.isEmpty()) { + return true; + } + for (long driverId : deviceDrivers) { if (chekingDriverId == driverId) { return true; } |