diff --git a/core/src/main/java/hudson/cli/CLICommand.java b/core/src/main/java/hudson/cli/CLICommand.java index 2e9f5bec743e2c95ce47cb799161055946ca9441..c5a672ff40bb73074d65b7451f873b9e82c31e16 100644 --- a/core/src/main/java/hudson/cli/CLICommand.java +++ b/core/src/main/java/hudson/cli/CLICommand.java @@ -365,6 +365,11 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable { } protected Charset getClientCharset() throws IOException, InterruptedException { + if (channel==null) + // for SSH, assume the platform default encoding + // this is in-line with the standard SSH behavior + return Charset.defaultCharset(); + String charsetName = checkChannel().call(new GetCharset()); try { return Charset.forName(charsetName);