Skip to content

Commit

Permalink
Fix NPE on inventory interact
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 committed Oct 7, 2024
1 parent 78df927 commit b19ddaa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/main/java/tc/oc/pgm/spawns/states/Observing.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ public void onEvent(EntityDamageEvent event) {
public void onEvent(InventoryClickEvent event) {
super.onEvent(event);

if (!(event.getClickedInventory() instanceof PlayerInventory
|| event.getClickedInventory().getType() == InventoryType.CRAFTING)
var inv = event.getInventory();
if (inv == null
|| !(inv instanceof PlayerInventory || inv.getType() == InventoryType.CRAFTING)
|| event.getCursor() == null) return;

ItemStack item = event.getCursor();
Expand Down

0 comments on commit b19ddaa

Please sign in to comment.