Skip to content

Commit

Permalink
Additional online check in inventory task type
Browse files Browse the repository at this point in the history
Fixes NPE on logout
  • Loading branch information
Krakenied committed Sep 26, 2023
1 parent 157a13f commit c9d978f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit c9d978f

Please sign in to comment.