aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-10-20 17:35:35 -0700
committerAnton Tananaev <anton@traccar.org>2023-10-20 17:35:35 -0700
commitb7145ea2e9d7efabb0d9806e76e7ac2995e56b27 (patch)
tree0e58df9f4f092df661ae7d868e19c239b7071fbc /src/main/java
parenta08bc10a8fd15a6b0fa4c04607eeae325e0c5407 (diff)
downloadtrackermap-server-b7145ea2e9d7efabb0d9806e76e7ac2995e56b27.tar.gz
trackermap-server-b7145ea2e9d7efabb0d9806e76e7ac2995e56b27.tar.bz2
trackermap-server-b7145ea2e9d7efabb0d9806e76e7ac2995e56b27.zip
Fix DSM response handling
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java b/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java
index 5a6425e7e..f6712d7f2 100644
--- a/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java
@@ -138,10 +138,13 @@ public class DualcamProtocolDecoder extends BaseProtocolDecoder {
break;
case MSG_PATH_RESPONSE:
String file = buf.readCharSequence(buf.readUnsignedShort(), StandardCharsets.US_ASCII).toString();
- ByteBuf response = Unpooled.buffer();
- response.writeShort(MSG_FILE_REQUEST);
- response.writeShort(file.length());
- response.writeCharSequence(file, StandardCharsets.US_ASCII);
+ if (channel != null) {
+ ByteBuf response = Unpooled.buffer();
+ response.writeShort(MSG_FILE_REQUEST);
+ response.writeShort(file.length());
+ response.writeCharSequence(file, StandardCharsets.US_ASCII);
+ channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
+ }
break;
default:
break;