From 7501eabd2e464a634a3145d8c075b49fa1cd2ed7 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 21 Jul 2018 15:06:04 +1000 Subject: [PATCH] Potentiall fix NPE on server shutdown --- bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index 653384e4..8aa5e82e 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -589,11 +589,12 @@ public class FaweBukkit implements IFawe, Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerQuit(PlayerQuitEvent event) { Player player = event.getPlayer(); - FawePlayer fp = FawePlayer.wrap(player); + String name = player.getName(); + FawePlayer fp = Fawe.get().getCachedPlayer(name); if (fp != null) { fp.unregister(); + Fawe.get().unregister(name); } - Fawe.get().unregister(event.getPlayer().getName()); } @Override