Fix crash from console-commands throwing exception. Fixes BUKKIT-2479

When 1.3.1 was released, a try-catch block was removed from the tick
loop that called the method in NMS to handle commands. This restores a
try-catch to prevent the console from crashing the server.
This commit is contained in:
Wesley Wolfe
2012-09-06 22:11:17 -05:00
parent c710ca827f
commit 4d5894e4cb
2 changed files with 14 additions and 2 deletions

View File

@@ -485,7 +485,12 @@ public final class CraftServer implements Server {
return true;
}
}
return dispatchCommand(sender, serverCommand.command);
try {
return dispatchCommand(sender, serverCommand.command);
} catch (Exception ex) {
getLogger().log(Level.WARNING, "Unexpected exception while parsing console command \"" + serverCommand.command + '"', ex);
return false;
}
}
public boolean dispatchCommand(CommandSender sender, String commandLine) {