aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/DeviceManager.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java
index 5681602fe..600669579 100644
--- a/src/org/traccar/database/DeviceManager.java
+++ b/src/org/traccar/database/DeviceManager.java
@@ -401,14 +401,12 @@ public class DeviceManager implements IdentityManager {
String result = null;
Device device = getDeviceById(deviceId);
if (device != null) {
- if (device.getAttributes().containsKey(attributeName)) {
- result = (String) device.getAttributes().get(attributeName);
- }
+ result = device.getString(attributeName);
if (result == null && lookupGroupsAttribute) {
long groupId = device.getGroupId();
while (groupId != 0) {
if (getGroupById(groupId) != null) {
- result = (String) getGroupById(groupId).getAttributes().get(attributeName);
+ result = getGroupById(groupId).getString(attributeName);
if (result != null) {
break;
}
@@ -421,7 +419,7 @@ public class DeviceManager implements IdentityManager {
if (result == null) {
if (lookupServer) {
Server server = Context.getPermissionsManager().getServer();
- result = (String) server.getAttributes().get(attributeName);
+ result = server.getString(attributeName);
} else {
result = Context.getConfig().getString(attributeName);
}