From 393b0d3d7a6c82bb3a4d070c431c1fd0bdb3cfae Mon Sep 17 00:00:00 2001 From: sk89q Date: Wed, 9 Jul 2014 23:05:40 -0700 Subject: [PATCH] Handle when CommandException.getMessage() is null in CommandManager. Related to WORLDEDIT-3156. --- .../worldedit/extension/platform/CommandManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java b/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java index 466903332..0d52e4b8c 100644 --- a/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java +++ b/src/main/java/com/sk89q/worldedit/extension/platform/CommandManager.java @@ -243,7 +243,13 @@ public final class CommandManager { actor.printRaw(t.getClass().getName() + ": " + t.getMessage()); t.printStackTrace(); } catch (CommandException e) { - actor.printError(e.getMessage()); + String message = e.getMessage(); + if (message != null) { + actor.printError(e.getMessage()); + } else + actor.printError("An unknown error has occurred! Please see console."); + logger.log(Level.SEVERE, "An unknown error occurred", e); + } } finally { EditSession editSession = locals.get(EditSession.class);