diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-14 12:28:44 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-14 13:28:11 +0500 |
commit | b6ac9da5428f1177df360cdbfc58d219d3230a10 (patch) | |
tree | 4c7bd0d53db8afe44caca70e17c6494612a6eaca /src | |
parent | c0cbde51aa75a5b2df58b11e76527ee703289541 (diff) | |
download | trackermap-server-b6ac9da5428f1177df360cdbfc58d219d3230a10.tar.gz trackermap-server-b6ac9da5428f1177df360cdbfc58d219d3230a10.tar.bz2 trackermap-server-b6ac9da5428f1177df360cdbfc58d219d3230a10.zip |
Fix attributes copying
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/processing/CopyAttributesHandler.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/org/traccar/processing/CopyAttributesHandler.java b/src/org/traccar/processing/CopyAttributesHandler.java index a9e761c3d..9fbcfa73f 100644 --- a/src/org/traccar/processing/CopyAttributesHandler.java +++ b/src/org/traccar/processing/CopyAttributesHandler.java @@ -32,10 +32,14 @@ public class CopyAttributesHandler extends BaseDataHandler { @Override protected Position handlePosition(Position position) { String attributesString = Context.getDeviceManager().lookupAttributeString( - position.getDeviceId(), "processing.copyAttributes", null, true); + position.getDeviceId(), "processing.copyAttributes", "", true); Position last = getLastPosition(position.getDeviceId()); - if (attributesString != null && last != null) { - attributesString += Position.KEY_DRIVER_UNIQUE_ID + ","; + if (attributesString.isEmpty()) { + attributesString = Position.KEY_DRIVER_UNIQUE_ID; + } else { + attributesString += "," + Position.KEY_DRIVER_UNIQUE_ID; + } + if (last != null) { for (String attribute : attributesString.split("[ ,]")) { if (last.getAttributes().containsKey(attribute) && !position.getAttributes().containsKey(attribute)) { position.getAttributes().put(attribute, last.getAttributes().get(attribute)); |