[codec-memcache] Avoid NPE on channelInactive.

Motivation:
When no currentMessage has been set and the channel is inactive, a NPE is raised.

Modification:
Make sure that a currentMessage is available before checking the extras.

Result:
No more NPE raised potentially.
This commit is contained in:
Michael Nitschinger 2014-04-23 11:38:55 +02:00
parent b88c7d6f9a
commit 797d6d94a4

View File

@ -201,7 +201,7 @@ public abstract class AbstractBinaryMemcacheDecoder<M extends BinaryMemcacheMess
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx);
if (currentMessage.getExtras() != null) {
if (currentMessage != null && currentMessage.getExtras() != null) {
currentMessage.getExtras().release();
}