mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-26 00:19:43 +00:00
[FIX] Print a proper error when using tpaccept with no requester
This commit is contained in:
parent
5b5be164b6
commit
18b31a7e50
1 changed files with 12 additions and 4 deletions
|
@ -18,10 +18,17 @@ public class Commandtpaccept extends EssentialsCommand
|
||||||
@Override
|
@Override
|
||||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
final User requester;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
requester = ess.getUser(user.getTeleportRequest());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(_("noPendingRequest"));
|
||||||
|
}
|
||||||
|
|
||||||
final User requester = ess.getUser(user.getTeleportRequest());
|
if (!requester.isOnline())
|
||||||
|
|
||||||
if (requester == null || !requester.isOnline())
|
|
||||||
{
|
{
|
||||||
throw new Exception(_("noPendingRequest"));
|
throw new Exception(_("noPendingRequest"));
|
||||||
}
|
}
|
||||||
|
@ -77,4 +84,5 @@ public class Commandtpaccept extends EssentialsCommand
|
||||||
user.requestTeleport(null, false);
|
user.requestTeleport(null, false);
|
||||||
throw new NoChargeException();
|
throw new NoChargeException();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue