]> git.saurik.com Git - wxWidgets.git/commitdiff
fix crash which happened if you called SetAttr(NULL) followed by SetAttr(attr) (...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 12 Jun 2008 23:58:19 +0000 (23:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 12 Jun 2008 23:58:19 +0000 (23:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 580f1db4de03637ccea1d4128b2356f76877efeb..69debf772705481ca6244420c1e3dd2da89ffafd 100644 (file)
@@ -2590,8 +2590,12 @@ void wxGridCellAttrData::SetAttr(wxGridCellAttr *attr, int row, int col)
     int n = FindIndex(row, col);
     if ( n == wxNOT_FOUND )
     {
-        // add the attribute
-        m_attrs.Add(new wxGridCellWithAttr(row, col, attr));
+        if ( attr )
+        {
+            // add the attribute
+            m_attrs.Add(new wxGridCellWithAttr(row, col, attr));
+        }
+        //else: nothing to do
     }
     else
     {