NPE in ConnectionWatchdog fixed

pull/653/head
Nikita 8 years ago
parent ad2da8d1c1
commit af18eb09a3

@ -65,6 +65,7 @@ public class ConnectionWatchdog extends ChannelInboundHandlerAdapter {
@Override @Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception { public void channelInactive(ChannelHandlerContext ctx) throws Exception {
RedisConnection connection = RedisConnection.getFrom(ctx.channel()); RedisConnection connection = RedisConnection.getFrom(ctx.channel());
if (connection != null) {
connection.onDisconnect(); connection.onDisconnect();
if (!connection.isClosed()) { if (!connection.isClosed()) {
if (connection.isFastReconnect()) { if (connection.isFastReconnect()) {
@ -74,6 +75,7 @@ public class ConnectionWatchdog extends ChannelInboundHandlerAdapter {
reconnect(connection, 1); reconnect(connection, 1);
} }
} }
}
ctx.fireChannelInactive(); ctx.fireChannelInactive();
} }

Loading…
Cancel
Save