From eaace15120044a3e602fd3093b2412be03fd2133 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 1 Jun 2022 18:52:45 +0200 Subject: [PATCH] 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 --- .../netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -> { -- 2.36.6