From 787426218b5c444953343dbb7d1e18eb0f3420cd Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 30 Jul 2017 13:56:56 +0200 Subject: [PATCH] Fixed NPE when product does not have item meta --- src/main/java/de/epiceric/shopchest/shop/Shop.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/epiceric/shopchest/shop/Shop.java b/src/main/java/de/epiceric/shopchest/shop/Shop.java index e98e071..2a4d438 100644 --- a/src/main/java/de/epiceric/shopchest/shop/Shop.java +++ b/src/main/java/de/epiceric/shopchest/shop/Shop.java @@ -185,7 +185,7 @@ public class Shop { requirements.put(HologramFormat.Requirement.VENDOR, getVendor().getName()); requirements.put(HologramFormat.Requirement.AMOUNT, getProduct().getAmount()); requirements.put(HologramFormat.Requirement.ITEM_TYPE, getProduct().getType() + (getProduct().getDurability() > 0 ? ":" + getProduct().getDurability() : "")); - requirements.put(HologramFormat.Requirement.ITEM_NAME, getProduct().getItemMeta().getDisplayName()); + requirements.put(HologramFormat.Requirement.ITEM_NAME, getProduct().hasItemMeta() ? getProduct().getItemMeta().getDisplayName() : null); requirements.put(HologramFormat.Requirement.HAS_ENCHANTMENT, !LanguageUtils.getEnchantmentString(ItemUtils.getEnchantments(getProduct())).isEmpty()); requirements.put(HologramFormat.Requirement.BUY_PRICE, getBuyPrice()); requirements.put(HologramFormat.Requirement.SELL_PRICE, getSellPrice());