mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-15 23:25:21 +01:00
Caught NullPointerException caused by getting the players list too early.
This commit is contained in:
parent
8192a1962a
commit
c96bb890b4
@ -146,15 +146,18 @@ private static Set<Integer> toBlockIDSet(String str) {
|
||||
public void postReload() {
|
||||
invinciblePlayers.clear();
|
||||
amphibiousPlayers.clear();
|
||||
|
||||
for (Player player : etc.getServer().getPlayerList()) {
|
||||
if (player.isInGroup("wg-invincible")) {
|
||||
invinciblePlayers.add(player.getName());
|
||||
}
|
||||
|
||||
if (player.isInGroup("wg-amphibious")) {
|
||||
amphibiousPlayers.add(player.getName());
|
||||
try {
|
||||
for (Player player : etc.getServer().getPlayerList()) {
|
||||
if (player.isInGroup("wg-invincible")) {
|
||||
invinciblePlayers.add(player.getName());
|
||||
}
|
||||
|
||||
if (player.isInGroup("wg-amphibious")) {
|
||||
amphibiousPlayers.add(player.getName());
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException e) { // Thrown if loaded too early
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user