mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-15 23:35:14 +01:00
Modified file to avoid an NPE.
This commit is contained in:
parent
b2c4a2d929
commit
8d9a2597a0
@ -118,12 +118,10 @@ public class AdminTeleportCommand extends CompositeCommand {
|
||||
|
||||
private Location getSpot(World world) {
|
||||
Island island = getIslands().getIsland(world, targetUUID);
|
||||
if (island != null && island.getSpawnPoint(world.getEnvironment()) != null) {
|
||||
// Return the defined spawn point
|
||||
return island.getSpawnPoint(world.getEnvironment());
|
||||
if (island == null) {
|
||||
return null;
|
||||
}
|
||||
// Return the default island protection center
|
||||
return island.getProtectionCenter().toVector().toLocation(world);
|
||||
return island.getSpawnPoint(world.getEnvironment()) != null ? island.getSpawnPoint(world.getEnvironment()) : island.getProtectionCenter().toVector().toLocation(world);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user