diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java b/src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java index d2a00849ce..6cbcc9d30b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java @@ -39,11 +39,11 @@ public class InventoryWrapper implements IInventory { // Copied from CraftItemStack ItemStack stack = getItem(i); ItemStack result; - if (stack == null) { - return null; + if (stack.isEmpty()) { + return stack; } if (stack.getCount() <= j) { - this.setItem(i, null); + this.setItem(i, ItemStack.a); result = stack; } else { result = CraftItemStack.copyNMSStack(stack, j); @@ -58,11 +58,11 @@ public class InventoryWrapper implements IInventory { // Copied from CraftItemStack ItemStack stack = getItem(i); ItemStack result; - if (stack == null) { - return null; + if (stack.isEmpty()) { + return stack; } if (stack.getCount() <= 1) { - this.setItem(i, null); + this.setItem(i, ItemStack.a); result = stack; } else { result = CraftItemStack.copyNMSStack(stack, 1);