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,7 +299,9 @@ 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()) {
serial += ":enchantment-" + Quester.enchantmentString(e.getKey()) + " " + e.getValue(); if (e.getKey() != null) {
serial += ":enchantment-" + Quester.enchantmentString(e.getKey()) + " " + e.getValue();
}
} }
} }
if (is.hasItemMeta()) { if (is.hasItemMeta()) {