[Bleeding] Fix NPE with a null bedSpawnLocation. Fixes BUKKIT-1500

This commit is contained in:
EdGruberman authored and feildmaster committed 2012-12-10 01:40:20 -06:00
1 parent 4d2a92ed47
commit f18b3cdc76
2 files changed
+7 -2

No files matched your search

@@ -614,8 +614,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setBedSpawnLocation(Location location, boolean override) {
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
getHandle().spawnWorld = location.getWorld().getName();
if (location == null) {
getHandle().setRespawnPosition(null, override);
} else {
getHandle().setRespawnPosition(new ChunkCoordinates(location.getBlockX(), location.getBlockY(), location.getBlockZ()), override);
getHandle().spawnWorld = location.getWorld().getName();
}
}
public void hidePlayer(Player player) {