From 66380e6d1412168b30cefaa979df82ea1869f2b7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 6 Sep 2012 22:11:17 -0500 Subject: [PATCH] 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. By: Wesley Wolfe --- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 500c490934..f11f7329e3 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -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) {