Check that enchantment keys are not null, fixes #566

This commit is contained in:
BuildTools 2018-12-08 17:32:43 -05:00
parent 8a94b4d255
commit 027d6d613b

View File

@ -299,9 +299,11 @@ public class ItemUtil {
} }
if (is.getEnchantments().isEmpty() == false) { if (is.getEnchantments().isEmpty() == false) {
for (Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) { for (Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) {
if (e.getKey() != null) {
serial += ":enchantment-" + Quester.enchantmentString(e.getKey()) + " " + e.getValue(); serial += ":enchantment-" + Quester.enchantmentString(e.getKey()) + " " + e.getValue();
} }
} }
}
if (is.hasItemMeta()) { if (is.hasItemMeta()) {
ItemMeta meta = is.getItemMeta(); ItemMeta meta = is.getItemMeta();
if (meta.hasDisplayName()) { if (meta.hasDisplayName()) {