Replaced unneeded test with check for resultSet.