diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r-- | src/main/java/org/traccar/protocol/DualcamProtocolDecoder.java | 11 |
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; |