Skip to content

Commit

Permalink
Fix NPE in duels module
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Jul 21, 2024
1 parent 582432b commit 24b1916
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public void onCreateExecutor(ArenaCreateExecutorEvent event) {
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
UUID requested = this.duelRequests.remove(event.getPlayer().getUniqueId());
if (requested == null) {
return;
}

Player requestedPlayer = Bukkit.getPlayer(requested);
if (requestedPlayer != null) {
DuelsMessages.DUEL_REQUESTED_CANCELLED_QUIT.send(requestedPlayer, event.getPlayer().getName());
Expand Down

0 comments on commit 24b1916

Please sign in to comment.