From: Jaakko Salli Date: Tue, 18 Nov 2008 18:46:30 +0000 (+0000) Subject: Allow wxPropertyGridInterface::ClearSelection() to be called with NULL state (fixes... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3c5c6707dee3546e8ffb9af764863203489f3604 Allow wxPropertyGridInterface::ClearSelection() to be called with NULL state (fixes defect #10195) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 8bb38aaa94..13b09fc78d 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -361,11 +361,16 @@ bool wxPropertyGridInterface::ClearSelection( bool validation ) flags |= wxPG_SEL_NOVALIDATE; wxPropertyGridPageState* state = m_pState; - wxPropertyGrid* pg = state->GetGrid(); - if ( pg->GetState() == state ) - return pg->DoSelectProperty(NULL, flags); - else - state->SetSelection(NULL); + + if ( state ) + { + wxPropertyGrid* pg = state->GetGrid(); + if ( pg->GetState() == state ) + return pg->DoSelectProperty(NULL, flags); + else + state->SetSelection(NULL); + } + return true; }