aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-10-09 16:10:53 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-10-09 16:10:53 -0700
commit91e6409a0c012106cec454e5953fab2e4b558972 (patch)
tree4b19f0e0adf0abba087dd9ee2276112f6104064e /src
parentcdb2d2aa151f900bf16af22538b6049daf7e494c (diff)
downloadtrackermap-server-91e6409a0c012106cec454e5953fab2e4b558972.tar.gz
trackermap-server-91e6409a0c012106cec454e5953fab2e4b558972.tar.bz2
trackermap-server-91e6409a0c012106cec454e5953fab2e4b558972.zip
Handle no location
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index a9da34e6e..4c71d3724 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -1253,6 +1253,10 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
}
+ if (position.getFixTime() == null) {
+ getLastLocation(position, null);
+ }
+
sendResponse(channel, false, MSG_GPS_MODULAR, buf.readUnsignedShort(), null);
return position;
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index fd1eb3040..3caba32e6 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -17,6 +17,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"78780D01086471700328358100093F040D0A"));
+ verifyNotNull(decoder, binary(
+ "797900377000000001020035000103002c0004616219d00043000b013601048153931500001a0001000808652820400643521000000101004e46760d0a"));
+
verifyNull(decoder, binary(
"7878171915061810051a01f90101700d08c8f50c0000065494ae0d0a"));