SPIGOT-2369: Tab completing non existant command

This commit is contained in:
md_5 2016-06-09 20:47:39 +10:00
parent 5a55e13868
commit 5fc80916f5

View file

@ -24,7 +24,7 @@ public class ConsoleCommandCompleter implements Completer {
protected List<String> evaluate() {
List<String> offers = server.getCommandMap().tabComplete(server.getConsoleSender(), buffer);
TabCompleteEvent tabEvent = new TabCompleteEvent(server.getConsoleSender(), buffer, offers);
TabCompleteEvent tabEvent = new TabCompleteEvent(server.getConsoleSender(), buffer, (offers == null) ? Collections.EMPTY_LIST : offers);
server.getPluginManager().callEvent(tabEvent);
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();