diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-07-26 02:33:25 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-07-26 02:33:25 +1200 |
commit | c51a5b70169860c9032420381dd327c6b4b380ba (patch) | |
tree | 7b94e5c9688cb7674a1f30fa4ea5b1da618695d8 /src/org | |
parent | 8c76bf440cc83e4c35548a56da5cf7c5e44d0545 (diff) | |
download | trackermap-server-c51a5b70169860c9032420381dd327c6b4b380ba.tar.gz trackermap-server-c51a5b70169860c9032420381dd327c6b4b380ba.tar.bz2 trackermap-server-c51a5b70169860c9032420381dd327c6b4b380ba.zip |
Handle GoSafe GPS without altitude
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/GoSafeProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java index f3900a61b..9d6a61d52 100644 --- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -86,7 +86,9 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(UnitsConverter.knotsFromKph(Integer.parseInt(values[index - 1]))); } position.setCourse(Integer.parseInt(values[index++])); - position.setAltitude(Integer.parseInt(values[index++])); + if (index < values.length) { + position.setAltitude(Integer.parseInt(values[index++])); + } if (index < values.length) { position.set(Position.KEY_HDOP, Double.parseDouble(values[index++])); } |