From 6b58aa77a069003584c2836591a7949f5ebca7fa Mon Sep 17 00:00:00 2001 From: aurora Date: Tue, 8 Sep 2020 18:08:23 +0000 Subject: [PATCH] fix npe when passing null to displayname for an item in an inventory menu --- .../java/com/songoda/skyblock/utils/item/nInventoryUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/skyblock/utils/item/nInventoryUtil.java b/src/main/java/com/songoda/skyblock/utils/item/nInventoryUtil.java index bf5d69a7..c578eb73 100644 --- a/src/main/java/com/songoda/skyblock/utils/item/nInventoryUtil.java +++ b/src/main/java/com/songoda/skyblock/utils/item/nInventoryUtil.java @@ -192,7 +192,7 @@ public class nInventoryUtil { public Item(ItemStack is, String itemDisplayname, List itemLore, Placeholder[] placeholders, Enchantment[] itemEnchantments, ItemFlag[] itemFlags) { this.is = is; - this.itemDisplayname = ChatColor.translateAlternateColorCodes('&', itemDisplayname); + this.itemDisplayname = itemDisplayname == null ? null : ChatColor.translateAlternateColorCodes('&', itemDisplayname); this.itemLore = itemLore; this.placeholders = placeholders; this.itemEnchantments = itemEnchantments;