summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbanip.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
index 591542bcb..36ea479f9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
@@ -30,7 +30,11 @@ public class Commandbanip extends EssentialsCommand
}
else
{
- ess.getServer().banIP(u.getAddress().getAddress().getHostAddress());
+ final String ipAddress = u.getLastLoginAddress();
+ if (ipAddress.length() == 0) {
+ throw new Exception(Util.i18n("playerNotFound"));
+ }
+ ess.getServer().banIP(u.getLastLoginAddress());
sender.sendMessage(Util.i18n("banIpAddress"));
}
}