aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-05-30 11:41:03 -0700
committerAnton Tananaev <anton@traccar.org>2023-05-30 11:41:03 -0700
commit8de9a36abef8e66be4fcc248b49045ffd3b5f7ae (patch)
tree26328afdb475f377d2e4e016fa91dd3ddcf97fac /src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
parent854afb13bd8115a17b9c6c4cf739707313a709cf (diff)
downloadtrackermap-server-8de9a36abef8e66be4fcc248b49045ffd3b5f7ae.tar.gz
trackermap-server-8de9a36abef8e66be4fcc248b49045ffd3b5f7ae.tar.bz2
trackermap-server-8de9a36abef8e66be4fcc248b49045ffd3b5f7ae.zip
Handle missing GoSafe fields
Diffstat (limited to 'src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
index 77649a041..f17ea0e08 100644
--- a/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/GoSafeProtocolDecoder.java
@@ -93,14 +93,14 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(Integer.parseInt(values[index - 1])));
}
position.setCourse(Integer.parseInt(values[index++]));
- if (index < values.length) {
- position.setAltitude(Integer.parseInt(values[index++]));
+ if (index < values.length && !values[index++].isEmpty()) {
+ position.setAltitude(Integer.parseInt(values[index - 1]));
}
- if (index < values.length) {
- position.set(Position.KEY_HDOP, Double.parseDouble(values[index++]));
+ if (index < values.length && !values[index++].isEmpty()) {
+ position.set(Position.KEY_HDOP, Double.parseDouble(values[index - 1]));
}
- if (index < values.length) {
- position.set(Position.KEY_VDOP, Double.parseDouble(values[index++]));
+ if (index < values.length && !values[index++].isEmpty()) {
+ position.set(Position.KEY_VDOP, Double.parseDouble(values[index - 1]));
}
break;
case "GSM":