From 0185a30ec9185ba5c36b461459d725d5f4c40968 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sun, 8 Jun 2014 18:21:13 +0200 Subject: [PATCH] Fix an IndexOutOfBoundsException: Index: 0 In SaveTimerTask.java Fixes #2039 --- .../java/com/gmail/nossr50/util/player/UserManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/player/UserManager.java b/src/main/java/com/gmail/nossr50/util/player/UserManager.java index 51dc76e4c..ffe3be1e3 100644 --- a/src/main/java/com/gmail/nossr50/util/player/UserManager.java +++ b/src/main/java/com/gmail/nossr50/util/player/UserManager.java @@ -59,10 +59,12 @@ public final class UserManager { } public static Collection getPlayers() { - Collection playerCollection = new ArrayList(); + Collection playerCollection = new ArrayList(); for (Player player : mcMMO.p.getServer().getOnlinePlayers()) { - playerCollection.add(getPlayer(player)); + if (hasPlayerDataKey(player)) { + playerCollection.add(getPlayer(player)); + } } return playerCollection;