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