Merge pull request #43 from A248/master

Update ChunkListener to fix a minor NPE bug
This commit is contained in:
Jitse Boonstra 2019-11-15 19:22:42 +01:00 committed by GitHub
commit 1d92363b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -45,8 +45,12 @@ public class ChunkListener implements Listener {
if (npc.getAutoHidden().contains(uuid)) {
continue;
}
npc.hide(Bukkit.getPlayer(uuid), true);
// Bukkit.getPlayer(uuid) sometimes returns null
Player player = Bukkit.getPlayer(uuid);
if (player != null) {
npc.hide(player, true);
}
}
}
}