diff options
author | Abyss777 <abyss@fox5.ru> | 2017-09-07 11:33:22 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-09-07 11:33:22 +0500 |
commit | 9ebd2a934a5ca3a61863f839733bff321ba30296 (patch) | |
tree | 265352fda7b704c240018f57e53c6626f166470d /src/org/traccar/protocol | |
parent | f0578c7b5f8737e019a9cf05935d2caaa940f0ca (diff) | |
download | trackermap-server-9ebd2a934a5ca3a61863f839733bff321ba30296.tar.gz trackermap-server-9ebd2a934a5ca3a61863f839733bff321ba30296.tar.bz2 trackermap-server-9ebd2a934a5ca3a61863f839733bff321ba30296.zip |
Handle correct and incorrect attribute types
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index c06582a15..15a71c88b 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -135,7 +135,17 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { try { position.set(entry.getKey(), Double.parseDouble(value)); } catch (NumberFormatException e) { - position.set(entry.getKey(), value); + switch (value) { + case "true": + position.set(entry.getKey(), true); + break; + case "false": + position.set(entry.getKey(), false); + break; + default: + position.set(entry.getKey(), value); + break; + } } break; } |