aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-19 05:48:03 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-05-19 05:48:03 +1200
commitd9c3568535f8a3ef9cedb43f7c48e839e2940d1f (patch)
tree47c87e8fdcc8322175f33bd07e10eacc523fcc70 /src/org/traccar
parent6b16c0ddf2ac1ce497e1d8bc17a47eceeabca113 (diff)
downloadtrackermap-server-d9c3568535f8a3ef9cedb43f7c48e839e2940d1f.tar.gz
trackermap-server-d9c3568535f8a3ef9cedb43f7c48e839e2940d1f.tar.bz2
trackermap-server-d9c3568535f8a3ef9cedb43f7c48e839e2940d1f.zip
Handle StarLink no location data
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/StarLinkProtocolDecoder.java7
1 files changed, 7 insertions, 0 deletions
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)));
}