Skip to content

Commit

Permalink
Fix NPE on inventory interact (#1406)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 authored Oct 7, 2024
1 parent d89b4fb commit cb27404
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 cb27404

Please sign in to comment.