]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed a severe crash bug
authorJaakko Salli <jaakko.salli@dnainternet.net>
Tue, 1 Sep 2009 13:13:58 +0000 (13:13 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Tue, 1 Sep 2009 13:13:58 +0000 (13:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgridiface.h
src/propgrid/propgridiface.cpp

index cb16eb93d9a3a178c8edbb55e5940b993094ba68..29d0116aad92fcd2aeba263b40432f14986b3669 100644 (file)
@@ -1349,13 +1349,17 @@ private:
     // Cannot be GetGrid() due to ambiguity issues.
     wxPropertyGrid* GetPropertyGrid()
     {
+        if ( !m_pState )
+            return NULL;
         return m_pState->GetGrid();
     }
 
     // Cannot be GetGrid() due to ambiguity issues.
     const wxPropertyGrid* GetPropertyGrid() const
     {
-        return (const wxPropertyGrid*) m_pState->GetGrid();
+        if ( !m_pState )
+            return NULL;
+        return static_cast<const wxPropertyGrid*>(m_pState->GetGrid());
     }
 #endif // #ifndef SWIG
 
index 88e51c6db28ce11fede7770ed3c1346844c9050d..1984ce6bb40d37243fbaa139a8e25ada3d080a20 100644 (file)
@@ -217,7 +217,9 @@ wxPGProperty* wxPropertyGridInterface::GetSelection() const
 bool wxPropertyGridInterface::ClearSelection( bool validation )
 {
     bool res = DoClearSelection(validation, wxPG_SEL_DONT_SEND_EVENT);
-    GetPropertyGrid()->Refresh();
+    wxPropertyGrid* pg = GetPropertyGrid();
+    if ( pg )
+        pg->Refresh();
     return res;
 }