mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-26 20:27:38 +01:00
Fixed rare NPE
This commit is contained in:
parent
7303c6b2de
commit
bb3f897312
@ -204,7 +204,9 @@ public class EnchantingListeners extends PluginDependent implements Listener {
|
|||||||
// Ew
|
// Ew
|
||||||
this.getPlugin().getScheduler().runLater(() -> {
|
this.getPlugin().getScheduler().runLater(() -> {
|
||||||
ItemStack item0 = event.getInventory().getItem(0);
|
ItemStack item0 = event.getInventory().getItem(0);
|
||||||
assert item0 != null;
|
if (item0 == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (item0.getItemMeta() instanceof EnchantmentStorageMeta) {
|
if (item0.getItemMeta() instanceof EnchantmentStorageMeta) {
|
||||||
EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item0.getItemMeta();
|
EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item0.getItemMeta();
|
||||||
for (Enchantment enchantment : meta.getStoredEnchants().keySet()) {
|
for (Enchantment enchantment : meta.getStoredEnchants().keySet()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user