#vulnerable code 
                              @Override
  public List<String> getSchemas() throws VerdictDBDbmsException {
    List<String> schemas = new ArrayList<>();
    DbmsQueryResult queryResult = execute(syntax.getSchemaCommand());
    JdbcResultSet jdbcResultSet = new JdbcResultSet(queryResult);
    try {
      while (queryResult.next()) {
        schemas.add(jdbcResultSet.getString(syntax.getSchemaNameColumnIndex()+1));
      }
    } catch (SQLException e) {
      throw new VerdictDBDbmsException(e);
    } finally {
      jdbcResultSet.close();
    }
    return schemas;
  } 
                            #location 5 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Override
  public List<String> getSchemas() throws VerdictDBDbmsException {
    List<String> schemas = new ArrayList<>();
    DbmsQueryResult queryResult = execute(syntax.getSchemaCommand());
    while (queryResult.next()) {
      schemas.add((String) queryResult.getValue(syntax.getSchemaNameColumnIndex()));
    }
    return schemas;
  }