Fixed NPE when people experience the chest crash

This commit is contained in:
Dinnerbone 2011-09-19 21:58:47 +01:00
parent 914a8a0c04
commit 5b68bae02e

View File

@ -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;
}
}