From 7d1a3d32e9ad368587480fed3d4f95578e5c2332 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 23 Jan 2017 16:22:11 +0000 Subject: [PATCH] Fix login NPE when async tasks run after the event has been fully handled --- .../src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java index 286a92b6..2e56a351 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/BukkitListener.java @@ -136,7 +136,7 @@ class BukkitListener extends AbstractListener implements Listener { } // The player got denied on sync login. - onLeave(e.getPlayer().getUniqueId()); + plugin.getServer().getScheduler().runTaskLater(plugin, () -> onLeave(e.getPlayer().getUniqueId()), 20L); } else { plugin.refreshAutoOp(e.getPlayer()); }