diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index cf3860dfcf..e11ff65602 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -2118,6 +2118,9 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, SWORD cType, int size, bool keyField, bool upd, bool insAllow, bool derivedCol) { + wxASSERT_MSG( index < noCols, + _T("Specified column index exceeds the maximum number of columns for this table.") ); + if (!colDefs) // May happen if the database connection fails return;