Skip to content

Commit

Permalink
Fix a npe on player quit (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed May 18, 2024
1 parent 87fbfb0 commit 854efe6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,11 @@ public void addRepeatingCrateTask(@NotNull final Player player, @NotNull final T
* @param player player that the crate is being ended for.
*/
public void removeCrateTask(@NotNull final Player player) {
this.timerTasks.remove(player.getUniqueId()).cancel();
TimerTask task = this.timerTasks.remove(player.getUniqueId());

if (task != null) {
task.cancel();
}
}

/**
Expand Down

0 comments on commit 854efe6

Please sign in to comment.