PNS: Don't add null items to drag

Not all footprint pad items are connected to elements in the PNS, so if
we don't find the parent element, we avoid later crashes/assertions by
skipping their addition

Fixes #3972 | https://gitlab.com/kicad/code/kicad/issues/3972
This commit is contained in:
Seth Hillbrand 2020-03-02 07:26:46 -08:00
parent 18db471967
commit 3c19704349
1 changed files with 6 additions and 2 deletions

View File

@ -1205,12 +1205,16 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
for ( const auto p : mod->Pads() )
{
auto solid = m_router->GetWorld()->FindItemByParent( p );
if( solid )
itemsToDrag.Add( solid );
}
}
else
{
startItem = m_router->GetWorld()->FindItemByParent( static_cast<const BOARD_CONNECTED_ITEM*>( item ) );
if( startItem)
itemsToDrag.Add( startItem );
}