Prevent crash if generator exists but has no items
See https://gitlab.com/kicad/code/kicad/-/issues/15366
This commit is contained in:
parent
1cb1fd3516
commit
37d9b7fac0
|
@ -2367,13 +2367,24 @@ bool PCB_SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem, bool aMultiSelect
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aItem->Type() == PCB_GENERATOR_T )
|
|
||||||
aItem = *( static_cast<PCB_GENERATOR*>( aItem )->GetItems().begin() );
|
|
||||||
|
|
||||||
if( !aItem )
|
if( !aItem )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch( aItem->Type() )
|
KICAD_T itemType = aItem->Type();
|
||||||
|
|
||||||
|
if( itemType == PCB_GENERATOR_T )
|
||||||
|
{
|
||||||
|
if( static_cast<PCB_GENERATOR*>( aItem )->GetItems().empty() )
|
||||||
|
{
|
||||||
|
wxASSERT_MSG( false, "Tried to select an empty generator" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemType = ( *static_cast<PCB_GENERATOR*>( aItem )->GetItems().begin() )->Type();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch( itemType )
|
||||||
{
|
{
|
||||||
case PCB_FOOTPRINT_T:
|
case PCB_FOOTPRINT_T:
|
||||||
if( !m_filter.footprints )
|
if( !m_filter.footprints )
|
||||||
|
|
Loading…
Reference in New Issue