Fixed NPE in CraftPlayer.getBedSpawnLocation

This commit is contained in:
Nathan Adams 2011-11-27 04:09:34 +00:00
parent 402e3c26e1
commit 8d49f500ec

View File

@ -534,7 +534,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public Location getBedSpawnLocation() {
World world = getServer().getWorld(getHandle().spawnWorld);
if (world != null) {
if ((world != null) && (getHandle().getBed() != null)) {
return new Location(world, getHandle().getBed().x, getHandle().getBed().y, getHandle().getBed().z);
} else {
return null;