1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-15 19:14:18 +02:00

Catch exception instead of checking for null

This commit is contained in:
snowleo
2011-11-27 19:13:39 +01:00
parent 9b4d0feb0f
commit 04b88cd0c4

View File

@@ -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"));
}