diff options
Diffstat (limited to 'src/main/java/eu/olli')
-rw-r--r-- | src/main/java/eu/olli/cowlection/handler/FriendsHandler.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/eu/olli/cowlection/handler/FriendsHandler.java b/src/main/java/eu/olli/cowlection/handler/FriendsHandler.java index a51fcd4..27e4a3a 100644 --- a/src/main/java/eu/olli/cowlection/handler/FriendsHandler.java +++ b/src/main/java/eu/olli/cowlection/handler/FriendsHandler.java @@ -153,7 +153,9 @@ public class FriendsHandler { this.bestFriends.clear(); if (!createdNewFile) { String bestFriendsData = FileUtils.readFileToString(this.bestFriendsFile, StandardCharsets.UTF_8); - this.bestFriends.addAll(parseJson(bestFriendsData)); + if (bestFriendsData.length() > 0) { + this.bestFriends.addAll(parseJson(bestFriendsData)); + } } } catch (IOException e) { main.getLogger().error("Couldn't read best friends file " + this.bestFriendsFile, e); |