diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp index daf9686b5e..1fbbcd0ef1 100644 --- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp +++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp @@ -1307,7 +1307,7 @@ QVariant QODBCResult::data(int field) bool QODBCResult::isNull(int field) { Q_D(const QODBCResult); - if (field < 0 || field > d->fieldCache.size()) + if (field < 0 || field >= d->fieldCache.size()) return true; if (field <= d->fieldCacheIdx) { // since there is no good way to find out whether the value is NULL