diff options
author | snowleo <schneeleo@gmail.com> | 2011-11-27 19:13:39 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-11-27 19:13:55 +0100 |
commit | ec6baa3621bb9d0a40f032f6669c11fa731be2c5 (patch) | |
tree | 87d6a26d5b4c9b6a6ad164cc94824a1710747864 | |
parent | 82f864a7f922e3a1bd83873e063cc591bfeb8f86 (diff) | |
download | Essentials-ec6baa3621bb9d0a40f032f6669c11fa731be2c5.tar Essentials-ec6baa3621bb9d0a40f032f6669c11fa731be2c5.tar.gz Essentials-ec6baa3621bb9d0a40f032f6669c11fa731be2c5.tar.lz Essentials-ec6baa3621bb9d0a40f032f6669c11fa731be2c5.tar.xz Essentials-ec6baa3621bb9d0a40f032f6669c11fa731be2c5.zip |
Catch exception instead of checking for null
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java index 2b22ede2c..c539a596c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java @@ -20,10 +20,14 @@ public class Commandunbanip extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - User user = getPlayer(server, args, 0, true); - if (user != null) { + try + { + final User user = getPlayer(server, args, 0, true); ess.getServer().unbanIP(user.getLastLoginAddress()); } + catch (Exception ex) + { + } ess.getServer().unbanIP(args[0]); sender.sendMessage(_("unbannedIP")); } |