mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 21:37:28 +01:00
Prevent NPE when removing enchantment with no ItemMeta (#6459)
This commit is contained in:
parent
9169cf73cc
commit
b9871610d1
1 changed files with 1 additions and 0 deletions
|
@ -183,6 +183,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- }
|
||||
+ // Paper start - replace entire method
|
||||
+ final ItemMeta itemMeta = this.getItemMeta();
|
||||
+ if (itemMeta == null) return 0;
|
||||
+ int level = itemMeta.getEnchantLevel(ench);
|
||||
+ if (level > 0) {
|
||||
+ itemMeta.removeEnchant(ench);
|
||||
|
|
Loading…
Add table
Reference in a new issue