From d9c3568535f8a3ef9cedb43f7c48e839e2940d1f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 19 May 2017 05:48:03 +1200 Subject: Handle StarLink no location data --- src/org/traccar/protocol/StarLinkProtocolDecoder.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/StarLinkProtocolDecoder.java b/src/org/traccar/protocol/StarLinkProtocolDecoder.java index 0e9840766..8fbecc35e 100644 --- a/src/org/traccar/protocol/StarLinkProtocolDecoder.java +++ b/src/org/traccar/protocol/StarLinkProtocolDecoder.java @@ -100,6 +100,9 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { int event = 0; for (int i = 0; i < Math.min(data.length, dataTags.length); i++) { + if (data[i].isEmpty()) { + continue; + } switch (dataTags[i]) { case "#EDT#": position.setDeviceTime(dateFormat.parse(data[i])); @@ -180,6 +183,10 @@ public class StarLinkProtocolDecoder extends BaseProtocolDecoder { } } + if (position.getFixTime() == null) { + getLastLocation(position, null); + } + if (lac != null && cid != null) { position.setNetwork(new Network(CellTower.fromLacCid(lac, cid))); } -- cgit v1.2.3