[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:
parent
8fd2f1c880
commit
65ee10fbd0
@ -201,7 +201,7 @@ public abstract class AbstractBinaryMemcacheDecoder<M extends BinaryMemcacheMess
|
|||||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||||
super.channelInactive(ctx);
|
super.channelInactive(ctx);
|
||||||
|
|
||||||
if (currentMessage.getExtras() != null) {
|
if (currentMessage != null && currentMessage.getExtras() != null) {
|
||||||
currentMessage.getExtras().release();
|
currentMessage.getExtras().release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user