mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Fix NPE on invalid enchant
This commit is contained in:
parent
f6e2db1eda
commit
fd0134227c
1 changed files with 4 additions and 0 deletions
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue