aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-10 19:03:40 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-10 19:03:40 -0600
commit6819ae24344f707c654f295bf02fbd64f9f59289 (patch)
tree09859cdd5f14b416a8ce74309bcd2d6a55522304
parenta4aeff1bbf26e46270212a3a1c17e3ac47d58647 (diff)
downloadtraccar-server-6819ae24344f707c654f295bf02fbd64f9f59289.tar.gz
traccar-server-6819ae24344f707c654f295bf02fbd64f9f59289.tar.bz2
traccar-server-6819ae24344f707c654f295bf02fbd64f9f59289.zip
Fixed NumberFormatException with hourmeter in Suntech devices
-rw-r--r--.gitignore1
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java4
2 files changed, 4 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index f2672aada..d6f8a2709 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ nbactions.xml
out
build
src/main/java/org/traccar/protobuf
+/bin/
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
index d8710a899..46486227e 100644
--- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -396,7 +396,9 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
if (isHbm(deviceSession.getDeviceId())) {
if (index < values.length) {
- position.set(Position.KEY_HOURS, UnitsConverter.msFromMinutes(Integer.parseInt(values[index++])));
+ if (values[index + 1] != "") {
+ position.set(Position.KEY_HOURS, UnitsConverter.msFromMinutes(Integer.parseInt(values[index++])));
+ }
}
if (index < values.length) {