mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-31 09:52:57 +00:00
Catch exception instead of checking for null
This commit is contained in:
parent
82f864a7f9
commit
ec6baa3621
1 changed files with 6 additions and 2 deletions
|
@ -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"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue