Merge pull request #115 from lolnetnz/crash

Prevent commands run from console crashing the entire instance
This commit is contained in:
Andrew Steinborn
2018-10-12 21:44:15 -04:00
committed by GitHub

View File

@@ -68,8 +68,12 @@ public final class VelocityConsole extends SimpleTerminalConsole implements Comm
@Override
protected void runCommand(String command) {
if (!this.server.getCommandManager().execute(this, command)) {
sendMessage(TextComponent.of("Command not found.", TextColor.RED));
try {
if (!this.server.getCommandManager().execute(this, command)) {
sendMessage(TextComponent.of("Command not found.", TextColor.RED));
}
} catch (Exception e) {
logger.error("An error occurred while running this command.", e);
}
}