diff --git a/src/be/jeffcheasey88/peeratcode/repository/DatabaseRepository.java b/src/be/jeffcheasey88/peeratcode/repository/DatabaseRepository.java index 4b8c2f3..b079442 100644 --- a/src/be/jeffcheasey88/peeratcode/repository/DatabaseRepository.java +++ b/src/be/jeffcheasey88/peeratcode/repository/DatabaseRepository.java @@ -116,8 +116,12 @@ public class DatabaseRepository { } 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"), - completionResult.getString("fileName"), completionResult.getInt("score")); + name, completionResult.getInt("score")); } private Player makePlayer(ResultSet playerResult) throws SQLException {