Fix an IndexOutOfBoundsException: Index: 0

In SaveTimerTask.java

Fixes #2039
This commit is contained in:
TfT_02 2014-06-08 18:21:13 +02:00
parent 38e1947302
commit 0185a30ec9

View File

@ -59,10 +59,12 @@ public final class UserManager {
} }
public static Collection<McMMOPlayer> getPlayers() { public static Collection<McMMOPlayer> getPlayers() {
Collection<McMMOPlayer> playerCollection = new ArrayList<McMMOPlayer>(); Collection<McMMOPlayer> playerCollection = new ArrayList<McMMOPlayer>();
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
playerCollection.add(getPlayer(player)); if (hasPlayerDataKey(player)) {
playerCollection.add(getPlayer(player));
}
} }
return playerCollection; return playerCollection;