From c9d978fb1700cb22ef915e4eca8865f6c34c0bc4 Mon Sep 17 00:00:00 2001 From: Krakenied Date: Tue, 26 Sep 2023 13:38:25 +0200 Subject: [PATCH] Additional online check in inventory task type Fixes NPE on logout --- .../quests/bukkit/tasktype/type/InventoryTaskType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java index e6fd94dd9..a399a0bc8 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java @@ -90,7 +90,7 @@ private void checkInventory(HumanEntity humanEntity, long delay) { } private void checkInventory(Player player, long delay) { - if (player.hasMetadata("NPC")) return; + if (player.hasMetadata("NPC") || !player.isOnline()) return; plugin.getScheduler().runTaskLaterAtEntity(player, () -> checkInventory(player), delay); }