aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/olli/cowlection/handler/FriendsHandler.java4
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);