Skip to content

Commit

Permalink
Fixed null clickedBlock exception (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
sh0inx authored Jun 17, 2024
1 parent 1799f00 commit 2db2494
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public void onClick(PlayerInteractEvent event) {
}
}

// If the item in hand is not a bank item, but the player did not click a block, this returns null.
// Normally, this isn't an issue, but we're not ignoring cancelled events to allow crystals to be deposited.
if(event.getClickedBlock() == null) return;

Optional<Island> island = IridiumSkyblock.getInstance().getTeamManager().getTeamViaPlayerLocation(player, event.getClickedBlock().getLocation());
if (!island.isPresent()) return;
if (!IridiumSkyblock.getInstance().getTeamManager().getTeamPermission(island.get(), user, PermissionType.BLOCK_BREAK)) {
Expand Down

0 comments on commit 2db2494

Please sign in to comment.