diff --git a/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java b/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java index 2816860382..a50ffebedc 100644 --- a/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java +++ b/handler/src/main/java/io/netty/handler/timeout/IdleStateHandler.java @@ -207,7 +207,7 @@ public class IdleStateHandler extends ChannelHandlerAdapter { @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { - if (ctx.channel().isActive() & ctx.channel().isRegistered()) { + if (ctx.channel().isActive() && ctx.channel().isRegistered()) { // channelActvie() event has been fired already, which means this.channelActive() will // not be invoked. We have to initialize here instead. initialize(ctx);