From: Robert Varga Date: Wed, 1 Jun 2022 16:52:45 +0000 (+0200) Subject: Guard connectPromise not being null X-Git-Tag: v4.0.0~57 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=netconf.git;a=commitdiff_plain;h=eaace15120044a3e602fd3093b2412be03fd2133 Guard connectPromise not being null Make sure that we validated the passed promise to not be null. Also fix debug output, which would show up null. Change-Id: Id7490dc57480192f135bf688a973713c3d30ea9c Signed-off-by: Robert Varga --- diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java index f9598210a6..213b4c1330 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java @@ -191,8 +191,8 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { @Override public synchronized void connect(final ChannelHandlerContext ctx, final SocketAddress remoteAddress, final SocketAddress localAddress, final ChannelPromise promise) throws Exception { - LOG.debug("SSH session connecting on channel {}. promise: {}", ctx.channel(), connectPromise); - connectPromise = promise; + LOG.debug("SSH session connecting on channel {}. promise: {}", ctx.channel(), promise); + connectPromise = requireNonNull(promise); if (negotiationFuture != null) { negotiationFutureListener = future -> {