From 31ed35407cf04b1781119e7ee5a99c9157f3cd86 Mon Sep 17 00:00:00 2001 From: Ramkumar Date: Fri, 13 Sep 2024 20:35:37 +0200 Subject: [PATCH] Check error stream is not null before notifying error (#961) Co-authored-by: Jeroen van Erp --- .../sshj/connection/channel/direct/SessionChannel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionChannel.java b/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionChannel.java index 87395820..d15c5ea7 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionChannel.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionChannel.java @@ -225,7 +225,9 @@ protected void gotExtendedData(SSHPacket buf) @Override public void notifyError(SSHException error) { - err.notifyError(error); + if (err != null) { + err.notifyError(error); + } super.notifyError(error); }