From: Jaakko Salli Date: Thu, 3 Dec 2009 18:08:24 +0000 (+0000) Subject: Handle the rare case where wxPropertyGrid::HandleCustomEditorEvent() may receive... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1103c4ca052302f246658efd86fc349f8717f828 Handle the rare case where wxPropertyGrid::HandleCustomEditorEvent() may receive event before the grid state has been initialized. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 0fb5a5bf92..498bfc4e2d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3278,6 +3278,12 @@ bool wxPropertyGrid::DoEditorValidate() void wxPropertyGrid::HandleCustomEditorEvent( wxEvent &event ) { + // It is possible that this handler receives event even before + // the control has been properly initialized. Let's skip the + // event handling in that case. + if ( !m_pState ) + return; + wxPGProperty* selected = GetSelection(); // Somehow, event is handled after property has been deselected.