log = composeCoapRequest(
ctx.channel().id().asLongText().substring(26),
(CoapRequest) msg);
- } else {
- log = composeCoapResponse(
- ctx.channel().id().asLongText().substring(26),
- (CoapResponse) msg);
+ } else if (msg instanceof CoapResponse) {
+ log = composeCoapResponse(ctx.channel().id().asLongText()
+ .substring(26), (CoapResponse) msg);
}
- Log.v(log);
+ if (log != null) {
+ Log.v(log);
+ }
ctx.writeAndFlush(msg);
}
log = composeCoapRequest(
ctx.channel().id().asLongText().substring(26),
(CoapRequest) msg);
- } else {
- log = composeCoapResponse(
- ctx.channel().id().asLongText().substring(26),
- (CoapResponse) msg);
+ } else if (msg instanceof CoapResponse) {
+ log = composeCoapResponse(ctx.channel().id().asLongText()
+ .substring(26), (CoapResponse) msg);
}
- Log.v(log);
+ if (log != null) {
+ Log.v(log);
+ }
ctx.fireChannelRead(msg);
}