Skip to content

Commit

Permalink
Fix exception when a player is kicked after switching items (#46)
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
skbeh committed Mar 25, 2023
1 parent 0ce2296 commit a928bb8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public void onPlayerHeldItem(PlayerItemHeldEvent e) {
return;
}

Bukkit.getScheduler().runTask(this.plugin, () ->
this.plugin.updateHoldingSelectionItem(this.plugin.getPlayerData(player)));
Bukkit.getScheduler().runTask(this.plugin, () -> this.plugin.getOptionalPlayerData(player)
.ifPresent(this.plugin::updateHoldingSelectionItem));
}

@EventHandler
Expand Down

0 comments on commit a928bb8

Please sign in to comment.