Better error handling for BrigadierCommand in bungee lib

This commit is contained in:
Marc Baloup 2021-05-10 22:57:07 +02:00
parent 0d7033d8c9
commit 29d036a13f
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -42,8 +42,16 @@ public abstract class BrigadierCommand extends ChatStatic {
}
dispatcher = BrigadierDispatcher.getInstance();
LiteralArgumentBuilder<CommandSender> builder = buildCommand();
String[] aliases = getAliases();
LiteralArgumentBuilder<CommandSender> builder;
String[] aliases;
try {
builder = buildCommand();
aliases = getAliases();
} catch (Exception e) {
Log.severe("Exception encountered when building Brigadier command " + getClass().getName(), e);
return;
}
if (aliases == null)
aliases = new String[0];