From 75aa9f8ba896fe88f7842126081b367872a26c46 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Jan 2015 12:23:35 +1300 Subject: Update binary test cases --- .../traccar/protocol/MeiligaoProtocolDecoder.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 7dcfdb200..9c1f5bee9 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -141,17 +141,23 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { switch (command) { case MSG_LOGIN: - response = ChannelBuffers.wrappedBuffer(new byte[] {0x01}); - sendResponse(channel, id, MSG_LOGIN_RESPONSE, response); + if (channel != null) { + response = ChannelBuffers.wrappedBuffer(new byte[] {0x01}); + sendResponse(channel, id, MSG_LOGIN_RESPONSE, response); + } return null; case MSG_HEARTBEAT: - response = ChannelBuffers.wrappedBuffer(new byte[] {0x01}); - sendResponse(channel, id, MSG_HEARTBEAT, response); + if (channel != null) { + response = ChannelBuffers.wrappedBuffer(new byte[] {0x01}); + sendResponse(channel, id, MSG_HEARTBEAT, response); + } return null; case MSG_SERVER: - response = ChannelBuffers.copiedBuffer( - getMeiligaoServer(channel), Charset.defaultCharset()); - sendResponse(channel, id, MSG_SERVER, response); + if (channel != null) { + response = ChannelBuffers.copiedBuffer( + getMeiligaoServer(channel), Charset.defaultCharset()); + sendResponse(channel, id, MSG_SERVER, response); + } return null; case MSG_POSITION: case MSG_POSITION_LOGGED: -- cgit v1.2.3