Fixes NPE in admin tp if nether or end worlds don't exist.

This commit is contained in:
tastybento 2021-09-04 14:46:26 -07:00
parent 7621677c93
commit 74ded5a187

View File

@ -87,6 +87,10 @@ public class AdminTeleportCommand extends CompositeCommand {
world = getPlugin().getIWM().getEndWorld(getWorld());
}
Location warpSpot = getSpot(world);
if (world == null || warpSpot == null) {
user.sendMessage("general.errors.no-safe-location-found");
return false;
}
// Otherwise, ask the admin to go to a safe spot
String failureMessage = user.getTranslation("commands.admin.tp.manual", "[location]", warpSpot.getBlockX() + " " + warpSpot.getBlockY() + " "