]> git.saurik.com Git - wxWidgets.git/commitdiff
Added a wxASSERT_MSG in ::SetColDefs() to trap for the user sending an index that...
authorGeorge Tasker <gtasker@allenbrook.com>
Thu, 13 Jun 2002 17:48:40 +0000 (17:48 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Thu, 13 Jun 2002 17:48:40 +0000 (17:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/dbtable.cpp

index cf3860dfcfb1fcf1cbea72be97ecb60f5b7c2244..e11ff656029e1318cb77428e970aa5ddffed0e28 100644 (file)
@@ -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;