Bukkit/CraftBukkit — comment on commit eba0409be5c34b788c80f4bd2c5d0d0a04dfeca7
File: src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java line 30
By mikeprimm:

This seems to have some issues - seeing an exception when the slot is empty. it looks like getInventory().getItem(item) can return null, so the '.id' will kick out an NPE.