diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index f25f966404..99bccbefea 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1839,12 +1839,12 @@ bool wxPropertyGridPageState::IsChildCategory(wxPGProperty* p, void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete ) { + wxCHECK_RET(item != &m_regularArray && item != m_abcArray, + wxS("wxPropertyGrid: Do not attempt to remove the root item.")); + wxCHECK_RET( item->GetParent(), wxS("wxPropertyGrid: This property was already deleted.") ); - wxCHECK_RET( item != &m_regularArray && item != m_abcArray, - wxS("wxPropertyGrid: Do not attempt to remove the root item.") ); - wxPGProperty* parent = item->GetParent(); wxCHECK_RET( !parent->HasFlag(wxPG_PROP_AGGREGATE),