Move orphan-handling code down to bottom

This commit is contained in:
riking 2013-06-28 13:49:30 -07:00
parent 43f8f7b76e
commit f63c5e3310

View File

@ -353,8 +353,23 @@ public final class SQLDatabaseManager implements DatabaseManager {
}
catch (SQLException e) {}
}
// Problem, no rows returned
result.close();
}
catch (SQLException ex) {
printErrors(ex);
}
finally {
if (statement != null) {
try {
statement.close();
}
catch (SQLException e) {
// Ignore
}
}
}
// Problem, nothing was returned
// First, read User Id - this is to check for orphans
@ -375,28 +390,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
// Retry, and abort on re-failure
return loadPlayerProfile(playerName, false);
}
catch (SQLException ex) {
printErrors(ex);
}
finally {
if (statement != null) {
try {
statement.close();
}
catch (SQLException e) {
// Ignore
}
}
}
if (!create) {
return new PlayerProfile(playerName, false);
}
newUser(playerName);
return new PlayerProfile(playerName, true);
}
public void convertUsers(DatabaseManager destination) {
PreparedStatement statement = null;