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:
@@ -46,7 +46,11 @@ public class ChunkListener implements Listener {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user