Fixed NullPointerException on Mohist servers when processing inventory transactions

This commit is contained in:
Intelli 2024-05-19 12:36:38 -06:00
parent e7c5078035
commit cfb53f766e

View File

@ -317,7 +317,12 @@ public final class InventoryChangeListener extends Queue implements Listener {
return;
}
Location location = event.getSource().getLocation();
Inventory sourceInventory = event.getSource();
if (sourceInventory == null) {
return;
}
Location location = sourceInventory.getLocation();
if (location == null) {
return;
}
@ -327,7 +332,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
return;
}
InventoryHolder sourceHolder = PaperAdapter.ADAPTER.getHolder(event.getSource(), false);
InventoryHolder sourceHolder = PaperAdapter.ADAPTER.getHolder(sourceInventory, false);
if (sourceHolder == null) {
return;
}