Fix SWCommand with 0 args
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <git-5w3l@lixfel.de>
Dieser Commit ist enthalten in:
Lixfel 2024-07-03 22:17:39 +02:00
Ursprung 0caf885959
Commit e76473e0be

Datei anzeigen

@ -102,7 +102,7 @@ public abstract class AbstractSWCommand<T> {
protected final List<String> tabComplete(T sender, String alias, String[] args) throws IllegalArgumentException { protected final List<String> tabComplete(T sender, String alias, String[] args) throws IllegalArgumentException {
initialize(); initialize();
String string = args[args.length - 1].toLowerCase(); String string = args.length > 0 ? args[args.length - 1].toLowerCase() : "";
return Stream.concat(commandList.stream(), helpCommandList.stream()) return Stream.concat(commandList.stream(), helpCommandList.stream())
.filter(s -> !s.noTabComplete) .filter(s -> !s.noTabComplete)
.map(s -> s.tabComplete(sender, args)) .map(s -> s.tabComplete(sender, args))