From 8209800b62f47ef62c88379ee3864f41d928d129 Mon Sep 17 00:00:00 2001 From: Nasreddine Bac Ali Date: Sat, 30 Oct 2021 18:27:21 +0200 Subject: [PATCH] Fix `nuts exec` throwing NullPointerException --- .../standalone/wscommands/exec/DefaultNutsExecCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/nuts-runtime/src/main/java/net/thevpc/nuts/runtime/standalone/wscommands/exec/DefaultNutsExecCommand.java b/core/nuts-runtime/src/main/java/net/thevpc/nuts/runtime/standalone/wscommands/exec/DefaultNutsExecCommand.java index edfb7e853..72a5e0554 100755 --- a/core/nuts-runtime/src/main/java/net/thevpc/nuts/runtime/standalone/wscommands/exec/DefaultNutsExecCommand.java +++ b/core/nuts-runtime/src/main/java/net/thevpc/nuts/runtime/standalone/wscommands/exec/DefaultNutsExecCommand.java @@ -69,10 +69,10 @@ public NutsExecutableInformation which() { } terminal.out().flush(); terminal.err().flush(); - String[] ts = command.toArray(new String[0]); - if (ts.length == 0) { + if (command == null || command.size() == 0) { throw new NutsIllegalArgumentException(traceSession, NutsMessage.plain("missing command")); } + String[] ts = command.toArray(new String[0]); NutsExecutableInformationExt exec = null; execSession.setTerminal(terminal); NutsExecutionType executionType = this.getExecutionType();