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

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-11-18 11:07:02 +11:00
parent 9dad03430b
commit 7e4dfe78e5
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));
}
}