Fix sporadic NullPointerException

Fixes #1426
This commit is contained in:
Trask Stalnaker 2016-02-18 21:02:07 -08:00 committed by Eric Anderson
parent 86ef8e70b5
commit c10f5781b9
1 changed files with 2 additions and 2 deletions

View File

@ -132,14 +132,14 @@ class NettyClientTransport implements ManagedClientTransport {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (!future.isSuccess()) {
ChannelHandlerContext ctx = channel.pipeline().context(handler);
ChannelHandlerContext ctx = future.channel().pipeline().context(handler);
if (ctx != null) {
// NettyClientHandler doesn't propagate exceptions, but the negotiator will need the
// exception to fail any writes. Note that this fires after handler, because it is as if
// handler was propagating the notification.
ctx.fireExceptionCaught(future.cause());
}
channel.pipeline().fireExceptionCaught(future.cause());
future.channel().pipeline().fireExceptionCaught(future.cause());
}
}
}).channel();