From 92e3957a0ec9812cd05f8e62149a36923fb8ca46 Mon Sep 17 00:00:00 2001 From: Tahg Date: Wed, 6 Apr 2011 12:45:03 -0400 Subject: [PATCH] getContents now returns null for items whose underlying item is null --- .../java/org/bukkit/craftbukkit/inventory/CraftInventory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index a54b795630..822a250f4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -35,7 +35,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { net.minecraft.server.ItemStack[] mcItems = getInventory().getContents(); for (int i = 0; i < mcItems.length; i++ ) { - items[i] = new CraftItemStack(mcItems[i]); + items[i] = mcItems[i] == null ? null : new CraftItemStack(mcItems[i]); } return items;