From ee4d808513bf90b249fe583ee2812936edd454f5 Mon Sep 17 00:00:00 2001 From: Eredrim Date: Wed, 31 Jan 2024 22:20:40 +0100 Subject: [PATCH] fix: another NPE en kick - closes #164 --- .../slipcor/pvparena/listeners/PlayerListener.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/slipcor/pvparena/listeners/PlayerListener.java b/src/main/java/net/slipcor/pvparena/listeners/PlayerListener.java index b624eb7d..813b764a 100644 --- a/src/main/java/net/slipcor/pvparena/listeners/PlayerListener.java +++ b/src/main/java/net/slipcor/pvparena/listeners/PlayerListener.java @@ -699,11 +699,13 @@ public void onPlayerKicked(final PlayerKickEvent event) { final Player player = event.getPlayer(); final ArenaPlayer arenaPlayer = ArenaPlayer.fromPlayer(player); final Arena arena = arenaPlayer.getArena(); - if (arena == null && arenaPlayer.getQueuedArena() != null) { - for (ArenaModule mod : arenaPlayer.getQueuedArena().getMods()) { - if(mod.handleQueuedLeave(arenaPlayer)) { - arenaPlayer.unload(); - return; + if (arena == null) { + if (arenaPlayer.getQueuedArena() != null) { + for (ArenaModule mod : arenaPlayer.getQueuedArena().getMods()) { + if (mod.handleQueuedLeave(arenaPlayer)) { + arenaPlayer.unload(); + return; + } } } return; // no fighting player => OUT