From c6b019e8d9624c6829175ab5ee2da2df24d7e369 Mon Sep 17 00:00:00 2001 From: Greg Knox Date: Sat, 28 Dec 2024 14:24:50 +1000 Subject: [PATCH] NullPointerException (#970) --- src/main/java/net/schmizz/sshj/SocketClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/schmizz/sshj/SocketClient.java b/src/main/java/net/schmizz/sshj/SocketClient.java index dbc6e4ed..0c5f530c 100644 --- a/src/main/java/net/schmizz/sshj/SocketClient.java +++ b/src/main/java/net/schmizz/sshj/SocketClient.java @@ -96,8 +96,8 @@ public void connectVia(Channel channel, String hostname, int port) throws IOExce /** Connect using the supplied InputStream and OutputStream. */ public void connectVia(InputStream input, OutputStream output) throws IOException { - this.hostname = null; - this.port = -1; + this.hostname = "localhost"; + this.port = 65535; this.input = input; this.output = output; this.tunneled = true;