aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-11 06:27:03 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-11 06:27:12 -0700
commitb5d5ec43181a428741c312462024d17ff7fbc676 (patch)
tree0f8e9be5d6ba6c5840488ae026bd84a7fb49e8a2 /src/main/java/org/traccar
parent8a29f377df8cff9e3c693e3c1201ec0b942d7cd6 (diff)
downloadtrackermap-server-b5d5ec43181a428741c312462024d17ff7fbc676.tar.gz
trackermap-server-b5d5ec43181a428741c312462024d17ff7fbc676.tar.bz2
trackermap-server-b5d5ec43181a428741c312462024d17ff7fbc676.zip
Fix services decoding
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
index cd8d8e0cf..85589b064 100644
--- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2019 - 2023 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -148,7 +148,7 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
int type = buf.readUnsignedByte();
if (BitUtil.check(flags, 4)) {
- sendResponse(channel, remoteAddress, index, type, buf);
+ sendResponse(channel, remoteAddress, index, type, buf.slice());
}
if (type == MSG_DATA || type == MSG_SERVICES) {
@@ -179,8 +179,9 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
case 0x01:
deviceSession = getDeviceSession(
channel, remoteAddress, buf.readCharSequence(15, StandardCharsets.US_ASCII).toString());
-
- position.setDeviceId(deviceSession.getDeviceId());
+ if (deviceSession == null) {
+ return null;
+ }
break;
case 0x02:
long alarm = buf.readUnsignedIntLE();