From ff294e0ebadec5896402cafcbd8d9b36a61f98af Mon Sep 17 00:00:00 2001 From: George Tasker Date: Thu, 13 Jun 2002 17:48:40 +0000 Subject: [PATCH] Added a wxASSERT_MSG in ::SetColDefs() to trap for the user sending an index that is larger than the number of columns defined for the table git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dbtable.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.45.2