Fixed NPE in CraftPlayer.getBedSpawnLocation

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2011-11-27 04:09:34 +00:00
parent 2a560a3b24
commit 39ddc11033

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;