Bug fix makeCompetion if fileName is not in the resultSet

This commit is contained in:
Francois G 2023-04-20 18:47:15 +02:00
parent 27388e4a75
commit 7509c38dc0

View file

@ -116,8 +116,12 @@ public class DatabaseRepository {
} }
private Completion makeCompletion(int playerId, int puzzleId, ResultSet completionResult) throws SQLException { private Completion makeCompletion(int playerId, int puzzleId, ResultSet completionResult) throws SQLException {
String name = null;
if (hasColumn(completionResult, "fileName"))
name = completionResult.getString("fileName");
return new Completion(playerId, puzzleId, completionResult.getInt("tries"), return new Completion(playerId, puzzleId, completionResult.getInt("tries"),
completionResult.getString("fileName"), completionResult.getInt("score")); name, completionResult.getInt("score"));
} }
private Player makePlayer(ResultSet playerResult) throws SQLException { private Player makePlayer(ResultSet playerResult) throws SQLException {