Accounted for NMS getItem() returning null in recent commit.

This commit is contained in:
EvilSeph
2012-01-20 11:45:37 -05:00
parent 85ab95cec7
commit 1bbeec1f75
2 changed files with 2 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
}
public ItemStack getItem(int index) {
return getInventory().getItem(index).id == 0 ? null : new CraftItemStack(getInventory().getItem(index));
return (getInventory().getItem(index) == null || getInventory().getItem(index).id == 0) ? null : new CraftItemStack(getInventory().getItem(index));
}
public ItemStack[] getContents() {