Skip to content

Commit 9b7d59d

Browse files
committed
Fixed: Didn't call "next" before one row was fetched.
1 parent a0bac9b commit 9b7d59d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/java/com/blackrook/sql/SQL.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ public static <T> T getRow(Connection connection, Class<T> type, String query, O
199199

200200
try (ResultSet resultSet = statement.executeQuery())
201201
{
202-
return createObjectFromResultRow(type, resultSet);
202+
if (resultSet.next())
203+
return createObjectFromResultRow(type, resultSet);
204+
else
205+
return null;
203206
}
204207
}
205208
catch (SQLException e)

0 commit comments

Comments
 (0)