1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-18 20:41:37 +02:00

Fix NPE on invalid enchant

This commit is contained in:
GunfighterJ
2013-04-19 10:06:43 -05:00
parent 2ab5676e27
commit 52a92fc97c

View File

@@ -432,6 +432,10 @@ public class MetaItemStack
public void addEnchantment(final CommandSender sender, final boolean allowUnsafe, final Enchantment enchantment, final int level) throws Exception
{
if (enchantment == null)
{
throw new Exception(_("enchantmentNotFound"));
}
try
{
if (stack.getType().equals(Material.ENCHANTED_BOOK))