Avoiding NPEs when using ClientConnector directly.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
ffd8e303f1
commit
6753b43d41
|
@ -274,6 +274,7 @@ public class ClientConnector extends ContainerLifeCycle
|
|||
LOG.debug("Could not accept {}", channel);
|
||||
safeClose(channel);
|
||||
Promise<?> promise = (Promise<?>)context.get(CONNECTION_PROMISE_CONTEXT_KEY);
|
||||
if (promise != null)
|
||||
promise.failed(failure);
|
||||
}
|
||||
}
|
||||
|
@ -301,6 +302,7 @@ public class ClientConnector extends ContainerLifeCycle
|
|||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Could not connect to {}", context.get(REMOTE_SOCKET_ADDRESS_CONTEXT_KEY));
|
||||
Promise<?> promise = (Promise<?>)context.get(CONNECTION_PROMISE_CONTEXT_KEY);
|
||||
if (promise != null)
|
||||
promise.failed(failure);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue