diff --git a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java index cc659665d..8cf21b833 100644 --- a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java @@ -116,10 +116,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager { String line = ""; while ((line = in.readLine()) != null) { - // Length checks depend on last character being ':' - if (line.charAt(line.length() - 1) != ':') { - line = line + ":"; - } String[] character = line.split(":"); String name = character[0]; long lastPlayed; @@ -587,6 +583,10 @@ public final class FlatfileDatabaseManager implements DatabaseManager { String line = ""; while ((line = in.readLine()) != null) { + // Length checks depend on last character being ':' + if (line.charAt(line.length() - 1) != ':') { + line = line + ":"; + } String[] character = line.split(":"); // If they're valid, rewrite them to the file.