Return invalid wxPGCell on attempt to get a cell for unattached wxPGProperty
This is to avoid crash if GetCell() would be called for wxPGProperty not currently attached to a wxPropertyGrid.
This commit is contained in:
@@ -1693,6 +1693,11 @@ const wxPGCell& wxPGProperty::GetCell( unsigned int column ) const
|
||||
wxPropertyGrid* pg = GetGrid();
|
||||
wxASSERT_MSG( pg,
|
||||
wxS("Cannot get cell for detached property") );
|
||||
if ( !pg )
|
||||
{
|
||||
static const wxPGCell invalidCell;
|
||||
return invalidCell;
|
||||
}
|
||||
|
||||
if ( IsCategory() )
|
||||
return pg->GetCategoryDefaultCell();
|
||||
|
Reference in New Issue
Block a user