From a07734febfdefe19c2d13c37e8a5d72bc3e83667 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 1 Aug 2014 15:09:18 +0000 Subject: [PATCH] Check if PG exists before adding or deleting a choice to wxPGProperty. Because choice value can be added/deleted also to/from detached property object there is necessary to skip in wxPGProperty::InsertChoice and wxPGProperty::DeleteChoice the operations which are valid exclusively for property attached to the property grid. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/property.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 21da745cdb..c09a3e3ef0 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1900,7 +1900,7 @@ int wxPGProperty::InsertChoice( const wxString& label, int index, int value ) if ( sel != newSel ) SetChoiceSelection(newSel); - if ( this == pg->GetSelection() ) + if ( pg && this == pg->GetSelection() ) GetEditorClass()->InsertItem(pg->GetEditorControl(),label,index); return index; @@ -1930,7 +1930,7 @@ void wxPGProperty::DeleteChoice( int index ) if ( sel != newSel ) SetChoiceSelection(newSel); - if ( this == pg->GetSelection() ) + if ( pg && this == pg->GetSelection() ) GetEditorClass()->DeleteItem(pg->GetEditorControl(), index); }