From c70700f7b86771ad8d8a5f10c238e002e63db04e Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 27 Nov 2011 00:23:40 +0100 Subject: [PATCH] Fix banning random player (and all other commands where a empty player is given) --- .../com/earth2me/essentials/commands/EssentialsCommand.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java index 63717fcae..32d8ef979 100644 --- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java +++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java @@ -47,6 +47,10 @@ public abstract class EssentialsCommand implements IEssentialsCommand { throw new NotEnoughArgumentsException(); } + if (args[0].isEmpty()) + { + throw new NoSuchFieldException(_("playerNotFound")); + } final User user = ess.getUser(args[pos]); if (user != null) {