Skip to content

Commit

Permalink
Fixed crash in tab-completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinnerbone committed Jan 31, 2018
1 parent 0827fe1 commit 482e860
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import groovy.io.FileType
apply plugin: 'java-library'
apply plugin: 'maven'

version = '0.1.22'
version = '0.1.23'
group = 'com.mojang'

task wrapper(type: Wrapper) {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/com/mojang/brigadier/CommandDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.ParameterizedCommandExceptionType;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestion;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import com.mojang.brigadier.tree.CommandNode;
Expand Down Expand Up @@ -374,11 +375,12 @@ public CompletableFuture<Suggestions> getCompletionSuggestions(final ParseResult
@SuppressWarnings("unchecked") final CompletableFuture<Suggestions>[] futures = new CompletableFuture[parent.getChildren().size()];
int i = 0;
for (final CommandNode<S> node : parent.getChildren()) {
CompletableFuture<Suggestions> future = Suggestions.empty();
try {
futures[i++] = node.listSuggestions(context.build(parse.getReader().getString()), new SuggestionsBuilder(parse.getReader().getString(), start));
} catch (final CommandSyntaxException e) {
futures[i++] = Suggestions.empty();
future = node.listSuggestions(context.build(parse.getReader().getString()), new SuggestionsBuilder(parse.getReader().getString(), start));
} catch (final CommandSyntaxException ignored) {
}
futures[i++] = future;
}

final CompletableFuture<Suggestions> result = new CompletableFuture<>();
Expand Down

0 comments on commit 482e860

Please sign in to comment.