From 8d49f500ec98b5f721bd5202edba12d8158175f1 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 27 Nov 2011 04:09:34 +0000 Subject: [PATCH] Fixed NPE in CraftPlayer.getBedSpawnLocation --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 04b69b4487..bf404b4ac5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -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;