aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler/CopyAttributesHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/handler/CopyAttributesHandler.java')
-rw-r--r--src/main/java/org/traccar/handler/CopyAttributesHandler.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/handler/CopyAttributesHandler.java b/src/main/java/org/traccar/handler/CopyAttributesHandler.java
index 50d36471a..1fa47cfaa 100644
--- a/src/main/java/org/traccar/handler/CopyAttributesHandler.java
+++ b/src/main/java/org/traccar/handler/CopyAttributesHandler.java
@@ -46,8 +46,7 @@ public class CopyAttributesHandler extends BaseDataHandler {
Position last = cacheManager.getPosition(position.getDeviceId());
if (last != null && attributesString != null) {
for (String attribute : attributesString.split("[ ,]")) {
- if (last.getAttributes().containsKey(attribute)
- && !position.getAttributes().containsKey(attribute)) {
+ if (last.hasAttribute(attribute) && !position.hasAttribute(attribute)) {
position.getAttributes().put(attribute, last.getAttributes().get(attribute));
}
}