Skip to content

Commit

Permalink
[#3576] Fix NPE when running CLI
Browse files Browse the repository at this point in the history
The AmqpAdapter and CommandAndControl classes have been changed to pass
in a non-null ConfigurationPath when creating the JLine console
builtins.

Fixes #3576
  • Loading branch information
sophokles73 committed Oct 28, 2023
1 parent 1a41b29 commit 6fc41a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.eclipse.hono.client.device.amqp.AmqpAdapterClient;
import org.eclipse.hono.util.QoS;
import org.fusesource.jansi.AnsiConsole;
import org.jline.builtins.ConfigurationPath;
import org.jline.console.SystemRegistry;
import org.jline.console.impl.Builtins;
import org.jline.console.impl.SystemRegistryImpl;
Expand Down Expand Up @@ -252,7 +253,7 @@ private void readAndExecuteCommands() {
try {
final Supplier<Path> workDir = () -> Paths.get(System.getProperty("user.dir"));
// set up JLine built-in commands
final var builtins = new Builtins(workDir, null, null);
final var builtins = new Builtins(workDir, new ConfigurationPath(null, null), null);
builtins.rename(Builtins.Command.TTOP, "top");
builtins.alias("zle", "widget");
builtins.alias("bindkey", "keymap");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.eclipse.hono.util.Constants;
import org.eclipse.hono.util.MessageHelper;
import org.fusesource.jansi.AnsiConsole;
import org.jline.builtins.ConfigurationPath;
import org.jline.console.SystemRegistry;
import org.jline.console.impl.Builtins;
import org.jline.console.impl.SystemRegistryImpl;
Expand Down Expand Up @@ -162,7 +163,7 @@ private void readAndExecuteCommands() {
try {
final Supplier<Path> workDir = () -> Paths.get(System.getProperty("user.dir"));
// set up JLine built-in commands
final var builtins = new Builtins(workDir, null, null);
final var builtins = new Builtins(workDir, new ConfigurationPath(null, null), null);
builtins.rename(Builtins.Command.TTOP, "top");
builtins.alias("zle", "widget");
builtins.alias("bindkey", "keymap");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class ConnectionOptions {
names = { "--ca-file" },
description = {
"Absolute path to a file containing trusted CA certificates to enable encrypted communication.",
"If not set explicitly, the platform's default trust store will be used."
"This option is required for connecting to endpoints using TLS."
},
order = 4)
public Optional<String> trustStorePath;
Expand Down

0 comments on commit 6fc41a1

Please sign in to comment.