mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-18 04:21:31 +02:00
Catch exception instead of checking for null
This commit is contained in:
@@ -20,10 +20,14 @@ public class Commandunbanip extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
}
|
}
|
||||||
User user = getPlayer(server, args, 0, true);
|
try
|
||||||
if (user != null) {
|
{
|
||||||
|
final User user = getPlayer(server, args, 0, true);
|
||||||
ess.getServer().unbanIP(user.getLastLoginAddress());
|
ess.getServer().unbanIP(user.getLastLoginAddress());
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
ess.getServer().unbanIP(args[0]);
|
ess.getServer().unbanIP(args[0]);
|
||||||
sender.sendMessage(_("unbannedIP"));
|
sender.sendMessage(_("unbannedIP"));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user