✨ Throw AmbiguousNodeException for more ambiguous cases
This commit is contained in:
parent
829c310872
commit
5e27148d82
1 changed files with 3 additions and 1 deletions
|
|
@ -729,7 +729,9 @@ public final class CommandTree<C> {
|
||||||
}
|
}
|
||||||
final int size = node.children.size();
|
final int size = node.children.size();
|
||||||
for (final Node<CommandArgument<C, ?>> child : node.children) {
|
for (final Node<CommandArgument<C, ?>> child : node.children) {
|
||||||
if (child.getValue() != null && !child.getValue().isRequired() && size > 1) {
|
if (child.getValue() != null
|
||||||
|
&& !(child.getValue() instanceof StaticArgument)
|
||||||
|
&& size > 1) {
|
||||||
throw new AmbiguousNodeException(
|
throw new AmbiguousNodeException(
|
||||||
node.getValue(),
|
node.getValue(),
|
||||||
child.getValue(),
|
child.getValue(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue