mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-20 05:21:21 +02:00
Fix NPE on invalid enchant
This commit is contained in:
@@ -432,6 +432,10 @@ public class MetaItemStack
|
|||||||
|
|
||||||
public void addEnchantment(final CommandSender sender, final boolean allowUnsafe, final Enchantment enchantment, final int level) throws Exception
|
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
|
try
|
||||||
{
|
{
|
||||||
if (stack.getType().equals(Material.ENCHANTED_BOOK))
|
if (stack.getType().equals(Material.ENCHANTED_BOOK))
|
||||||
|
Reference in New Issue
Block a user