From cb8be8b82f41c535a461f9f40071adcc316595c3 Mon Sep 17 00:00:00 2001 From: riking Date: Wed, 31 Jul 2013 17:27:57 -0700 Subject: [PATCH] Use Long.parseLong because we have a use for the catch --- .../nossr50/database/FlatfileDatabaseManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java index 8bede9fa3..cc659665d 100644 --- a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java @@ -122,13 +122,13 @@ public final class FlatfileDatabaseManager implements DatabaseManager { } String[] character = line.split(":"); String name = character[0]; - long lastPlayed = StringUtils.getLong(character[37]) * Misc.TIME_CONVERSION_FACTOR; + long lastPlayed; boolean rewrite = false; - - if (lastPlayed == 0) { - OfflinePlayer player = Bukkit.getOfflinePlayer(name); - lastPlayed = player.getLastPlayed(); + try { + lastPlayed = Long.parseLong(character[37]) * Misc.TIME_CONVERSION_FACTOR; + } catch (NumberFormatException e) { rewrite = true; + lastPlayed = System.currentTimeMillis(); } if (currentTime - lastPlayed > PURGE_TIME) {