From 24b19169be1fb968fd3aa17c90a61cdc569764a8 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Sat, 20 Jul 2024 22:45:16 -0500 Subject: [PATCH] Fix NPE in duels module --- .../main/java/org/battleplugins/arena/module/duels/Duels.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/duels/src/main/java/org/battleplugins/arena/module/duels/Duels.java b/module/duels/src/main/java/org/battleplugins/arena/module/duels/Duels.java index a98dfa29..c979e43e 100644 --- a/module/duels/src/main/java/org/battleplugins/arena/module/duels/Duels.java +++ b/module/duels/src/main/java/org/battleplugins/arena/module/duels/Duels.java @@ -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());