mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Fix NPE when teleporting offline players (#4332)
This commit is contained in:
parent
cba5063b33
commit
a098055fc9
@ -25,7 +25,6 @@ public class Commandtp extends EssentialsCommand {
|
||||
switch (args.length) {
|
||||
case 0:
|
||||
throw new NotEnoughArgumentsException();
|
||||
|
||||
case 1:
|
||||
final User player = getPlayer(server, user, args, 0, false, true);
|
||||
|
||||
@ -33,9 +32,12 @@ public class Commandtp extends EssentialsCommand {
|
||||
throw new Exception(tl("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
|
||||
if (!player.getBase().isOnline() && user.isAuthorized("essentials.tpoffline")) {
|
||||
if (!player.getBase().isOnline()) {
|
||||
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())) {
|
||||
throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName()));
|
||||
|
Loading…
Reference in New Issue
Block a user