diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index c99018211..d5e3571d6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -24,6 +24,7 @@ public class Commandrealname extends EssentialsCommand throw new NotEnoughArgumentsException(); } final String whois = args[0].toLowerCase(Locale.ENGLISH); + boolean foundUser = false; for (Player onlinePlayer : server.getOnlinePlayers()) { final User u = ess.getUser(onlinePlayer); @@ -39,7 +40,12 @@ public class Commandrealname extends EssentialsCommand { continue; } + foundUser = true; sender.sendMessage(u.getDisplayName() + " " + _("is") + " " + u.getName()); } + if (!foundUser) + { + throw new NoSuchFieldException(_("playerNotFound")); + } } }