From 5b68bae02e550f82f060946d05092ff900e354eb Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Mon, 19 Sep 2011 21:58:47 +0100 Subject: [PATCH] Fixed NPE when people experience the chest crash --- src/main/java/net/minecraft/server/TileEntityChest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java index 4e03b29599..0616be1828 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -159,7 +159,11 @@ public class TileEntityChest extends TileEntity implements IInventory { if (entity instanceof TileEntityChest) { return (TileEntityChest)entity; } else { - world.getServer().getLogger().severe("Block at " + x + "," + y + "," + z + " is a chest but has a " + entity.getClass().getName()); + String name = "null"; + if (entity != null) { + name = entity.toString(); + } + world.getServer().getLogger().severe("Block at " + x + "," + y + "," + z + " is a chest but has a " + name); return null; } }