mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-05 23:08:23 +00:00
Fix NPE when teleporting offline players (#4332)
This commit is contained in:
parent
cba5063b33
commit
a098055fc9
1 changed files with 5 additions and 3 deletions
|
@ -25,7 +25,6 @@ public class Commandtp extends EssentialsCommand {
|
||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 0:
|
case 0:
|
||||||
throw new NotEnoughArgumentsException();
|
throw new NotEnoughArgumentsException();
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
final User player = getPlayer(server, user, args, 0, false, true);
|
final User player = getPlayer(server, user, args, 0, false, true);
|
||||||
|
|
||||||
|
@ -33,8 +32,11 @@ public class Commandtp extends EssentialsCommand {
|
||||||
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.getBase().isOnline() && user.isAuthorized("essentials.tpoffline")) {
|
if (!player.getBase().isOnline()) {
|
||||||
throw new Exception(tl("teleportOffline", player.getDisplayName()));
|
if (user.isAuthorized("essentials.tpoffline")) {
|
||||||
|
throw new Exception(tl("teleportOffline", player.getDisplayName()));
|
||||||
|
}
|
||||||
|
throw new PlayerNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) {
|
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) {
|
||||||
|
|
Loading…
Reference in a new issue