Skip to content

Commit

Permalink
Modified file to avoid an NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Dec 30, 2023
1 parent b2c4a2d commit 8d9a259
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ public boolean execute(User user, String label, List<String> args) {

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
Expand Down

0 comments on commit 8d9a259

Please sign in to comment.