diff --git a/cloud-core/src/main/java/cloud/commandframework/CommandTree.java b/cloud-core/src/main/java/cloud/commandframework/CommandTree.java index f18d0509..f4f06395 100644 --- a/cloud-core/src/main/java/cloud/commandframework/CommandTree.java +++ b/cloud-core/src/main/java/cloud/commandframework/CommandTree.java @@ -449,7 +449,6 @@ public final class CommandTree { // The value has to be a variable final Node> child = children.get(0); - // START: Compound arguments /* When we get in here, we need to treat compound arguments a little differently */ if (child.getValue() instanceof CompoundArgument) { @SuppressWarnings("unchecked") final CompoundArgument compoundArgument = (CompoundArgument) child @@ -474,8 +473,10 @@ public final class CommandTree { while (commandQueue.size() > 1) { commandQueue.remove(); } - } else if (child.getValue() != null) { - for (int i = 0; i < child.getValue().getParser().getRequestedArgumentCount() - 1 && commandQueue.size()> 1; i++) { + } else if (child.getValue() != null + && commandQueue.size() <= child.getValue().getParser().getRequestedArgumentCount()) { + for (int i = 0; i < child.getValue().getParser().getRequestedArgumentCount() - 1 + && commandQueue.size() > 1; i++) { commandContext.store( String.format("%s_%d", child.getValue().getName(), i), commandQueue.remove()