diff options
-rw-r--r-- | src/org/traccar/api/resource/DeviceResource.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/org/traccar/api/resource/DeviceResource.java b/src/org/traccar/api/resource/DeviceResource.java index 0bf0aa45f..2957d623c 100644 --- a/src/org/traccar/api/resource/DeviceResource.java +++ b/src/org/traccar/api/resource/DeviceResource.java @@ -64,18 +64,15 @@ public class DeviceResource extends BaseResource { } ArrayList<Device> devices = new ArrayList<>(); - if (!uniqueIds.isEmpty()) { - for (String uniqueId : uniqueIds) { - Device device = Context.getDeviceManager().getDeviceByUniqueId(uniqueId); - Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); - devices.add(device); - } + + for (String uniqueId : uniqueIds) { + Device device = Context.getDeviceManager().getDeviceByUniqueId(uniqueId); + Context.getPermissionsManager().checkDevice(getUserId(), device.getId()); + devices.add(device); } - if (!deviceIds.isEmpty()) { - for (Long deviceId : deviceIds) { - Context.getPermissionsManager().checkDevice(getUserId(), deviceId); - devices.add(Context.getDeviceManager().getDeviceById(deviceId)); - } + for (Long deviceId : deviceIds) { + Context.getPermissionsManager().checkDevice(getUserId(), deviceId); + devices.add(Context.getDeviceManager().getDeviceById(deviceId)); } return devices; } |