Skip to content

Commit 2bcbb1b

Browse files
committed
Fixed null clickedBlock exception
1 parent 1799f00 commit 2bcbb1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/iridium/iridiumskyblock/listeners/PlayerInteractListener.java

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public void onClick(PlayerInteractEvent event) {
3838
}
3939
}
4040

41+
// If the item in hand is not a bank item, but the player did not click a block, this returns null.
42+
// Normally, this isn't an issue, but we're not ignoring cancelled events to allow crystals to be deposited.
43+
if(event.getClickedBlock() == null) return;
44+
4145
Optional<Island> island = IridiumSkyblock.getInstance().getTeamManager().getTeamViaPlayerLocation(player, event.getClickedBlock().getLocation());
4246
if (!island.isPresent()) return;
4347
if (!IridiumSkyblock.getInstance().getTeamManager().getTeamPermission(island.get(), user, PermissionType.BLOCK_BREAK)) {

0 commit comments

Comments
 (0)