Update ChunkListener to fix a minor NPE bug
Fixes a NullPointerException at the root of the problem. Bukkit.getPlayer(UUID) can return a null value, so a simple null check will do the trick.
This commit is contained in:
parent
81b2bc3569
commit
b5621816cb
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue