diff --git a/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java index 3df35c64d..91554e6a1 100644 --- a/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/SQLDatabaseManager.java @@ -366,7 +366,12 @@ public final class SQLDatabaseManager implements DatabaseManager { private PlayerProfile loadPlayerProfile(String playerName, String uuid, boolean create, boolean retry) { if (!checkConnected()) { - return new PlayerProfile(playerName, false); // return fake profile if not connected + // return fake profile if not connected + if (uuid.isEmpty()) { + return new PlayerProfile(playerName, false); + } + + return new PlayerProfile(playerName, UUID.fromString(uuid), false); } PreparedStatement statement = null; @@ -1270,7 +1275,7 @@ public final class SQLDatabaseManager implements DatabaseManager { Map skillsXp = new HashMap(); // Skill & XP Map skillsDATS = new HashMap(); // Ability & Cooldown MobHealthbarType mobHealthbarType; - UUID uuid = null; + UUID uuid; final int OFFSET_SKILLS = 0; // TODO update these numbers when the query changes (a new skill is added) final int OFFSET_XP = 13; @@ -1326,9 +1331,10 @@ public final class SQLDatabaseManager implements DatabaseManager { } try { - UUID.fromString(result.getString(OFFSET_OTHER + 3)); + uuid = UUID.fromString(result.getString(OFFSET_OTHER + 3)); } catch (Exception e) { + uuid = null; } return new PlayerProfile(playerName, uuid, skills, skillsXp, skillsDATS, mobHealthbarType);