If a redirect returned nothing, return nothing.

This commit is contained in:
Nathan Adams 2017-11-06 15:02:37 +01:00
parent 43e18f6a04
commit 59a27953be

View file

@ -88,7 +88,11 @@ public class CommandDispatcher<S> {
if (child != null) {
if (!child.getNodes().isEmpty()) {
final RedirectModifier<S> modifier = Iterators.getLast(context.getNodes().keySet().iterator()).getRedirectModifier();
for (final S source : modifier.apply(context.build())) {
final Collection<S> results = modifier.apply(context.build());
if (results.isEmpty()) {
return 0;
}
for (final S source : results) {
contexts.add(child.copy().withSource(source));
}
}