aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
index 46486227e..4481b61f2 100644
--- a/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -396,13 +396,15 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
if (isHbm(deviceSession.getDeviceId())) {
if (index < values.length) {
- if (values[index + 1] != "") {
+ try {
position.set(Position.KEY_HOURS, UnitsConverter.msFromMinutes(Integer.parseInt(values[index++])));
- }
+ } catch (NumberFormatException e) {}
}
if (index < values.length) {
- position.set(Position.KEY_BATTERY, Double.parseDouble(values[index++]));
+ try {
+ position.set(Position.KEY_BATTERY, Double.parseDouble(values[index++]));
+ } catch (NumberFormatException e) {}
}
if (index < values.length && values[index++].equals("0")) {