From 56bd432719ad6b30b4bfa192a6c3afe28038f986 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 12 Jun 2020 17:29:04 -0400 Subject: [PATCH] check if null in getItemMeta --- .../slimefun4/utils/itemstack/ItemStackWrapper.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ItemStackWrapper.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ItemStackWrapper.java index e303e5074..db0225166 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ItemStackWrapper.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ItemStackWrapper.java @@ -45,7 +45,11 @@ public final class ItemStackWrapper extends ItemStack { // Since this class is immutable, we can simply let the super class create one copy // and then store that instead of creating a clone everytime. // This will significantly speed up any loop comparisons if used correctly. - return meta; + if (meta == null) { + throw new UnsupportedOperationException("#hasItemMeta() must be checked prior to this call"); + } else { + return meta; + } } @Override