diff --git a/Essentials/src/main/java/com/earth2me/essentials/Enchantments.java b/Essentials/src/main/java/com/earth2me/essentials/Enchantments.java index 29cf88d7b..cd6cf4b60 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/Enchantments.java +++ b/Essentials/src/main/java/com/earth2me/essentials/Enchantments.java @@ -277,6 +277,9 @@ public final class Enchantments { } public static Enchantment getByName(final String name) { + if (name == null || name.isEmpty()) { + return null; + } Enchantment enchantment = null; if (isFlat) { // 1.13+ only enchantment = Enchantment.getByKey(NamespacedKey.minecraft(name.toLowerCase())); @@ -287,7 +290,7 @@ public final class Enchantments { } if (enchantment == null) { enchantment = Enchantment.getByName(name.toLowerCase()); - } + } if (enchantment == null) { enchantment = Enchantment.getByName(name); }