From 5124f8f4626a49726f740749865837e8d671c248 Mon Sep 17 00:00:00 2001 From: Andrew Ardill Date: Thu, 29 Dec 2011 22:42:47 +1100 Subject: [PATCH] Test cloning of CraftItemStacks created with null nms ItemStacks --- .../bukkit/craftbukkit/inventory/CraftItemStackTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/CraftItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/CraftItemStackTest.java index 28ad98a514..a57ddca6d5 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/CraftItemStackTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/CraftItemStackTest.java @@ -25,4 +25,12 @@ public class CraftItemStackTest { assert (clone.getTypeId() == itemStack.getTypeId()); assert (clone.getData().equals(itemStack.getData())); } + + @Test + public void testCloneNullItem() throws Exception { + net.minecraft.server.ItemStack nmsItemStack = null; + ItemStack itemStack = new CraftItemStack(nmsItemStack); + ItemStack clone = itemStack.clone(); + assert (clone.equals(itemStack)); + } }