diff options
author | md_5 <git@md-5.net> | 2017-06-15 20:25:06 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-06-15 20:25:06 +1000 |
commit | 885da43758f1e15fc5dbe95cfa1f1020a871356f (patch) | |
tree | ab6ca06bd617582b12051532606d514378e9e6ba /src | |
parent | 732911efbcead46eae3ef1f4aa628e997966db5e (diff) | |
download | craftbukkit-885da43758f1e15fc5dbe95cfa1f1020a871356f.tar craftbukkit-885da43758f1e15fc5dbe95cfa1f1020a871356f.tar.gz craftbukkit-885da43758f1e15fc5dbe95cfa1f1020a871356f.tar.lz craftbukkit-885da43758f1e15fc5dbe95cfa1f1020a871356f.tar.xz craftbukkit-885da43758f1e15fc5dbe95cfa1f1020a871356f.zip |
SPIGOT-3342: Fix invalid usage of null in InventoryWrapper
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java b/src/main/java/org/bukkit/craftbukkit/inventory/InventoryWrapper.java index d2a00849..6cbcc9d3 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); |