aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-01-27 12:23:35 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-01-27 12:23:35 +1300
commit75aa9f8ba896fe88f7842126081b367872a26c46 (patch)
tree26390c9a42fb2324b525083dab9c28df4e368298 /src/org/traccar
parent0a7bfdfbcec8dbb587882c63919456a3855930b4 (diff)
downloadtrackermap-server-75aa9f8ba896fe88f7842126081b367872a26c46.tar.gz
trackermap-server-75aa9f8ba896fe88f7842126081b367872a26c46.tar.bz2
trackermap-server-75aa9f8ba896fe88f7842126081b367872a26c46.zip
Update binary test cases
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java20
1 files changed, 13 insertions, 7 deletions
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: