SPIGOT-2787: Keep performing getter null conversion at call sites

This commit is contained in:
md_5
2016-11-18 11:07:02 +11:00
parent 0c3bb76487
commit 93b8244115
6 changed files with 24 additions and 11 deletions

View File

@@ -25,4 +25,12 @@ public class NMSCraftItemStackTest extends AbstractTestingBase {
assertThat(clone.getData(), is(itemStack.getData()));
assertThat(clone, is(itemStack));
}
@Test
public void testCloneNullItem() throws Exception {
net.minecraft.server.ItemStack nmsItemStack = null;
ItemStack itemStack = CraftItemStack.asCraftMirror(nmsItemStack);
ItemStack clone = itemStack.clone();
assertThat(clone, is(itemStack));
}
}