Skip to content

Commit

Permalink
fix: another NPE en kick - closes #164
Browse files Browse the repository at this point in the history
  • Loading branch information
Eredrim committed Jan 31, 2024
1 parent d2969e5 commit ee4d808
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/net/slipcor/pvparena/listeners/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee4d808

Please sign in to comment.