aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-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();