Caught NullPointerException caused by getting the players list too early.

This commit is contained in:
sk89q 2010-12-01 22:43:36 -08:00
parent 8192a1962a
commit c96bb890b4

View File

@ -146,15 +146,18 @@ private static Set<Integer> toBlockIDSet(String str) {
public void postReload() { public void postReload() {
invinciblePlayers.clear(); invinciblePlayers.clear();
amphibiousPlayers.clear(); amphibiousPlayers.clear();
for (Player player : etc.getServer().getPlayerList()) {
if (player.isInGroup("wg-invincible")) {
invinciblePlayers.add(player.getName());
}
if (player.isInGroup("wg-amphibious")) { try {
amphibiousPlayers.add(player.getName()); 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
} }
} }