From 3c1970434993eb8d09b0190a218a17c79da75e14 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 2 Mar 2020 07:26:46 -0800 Subject: [PATCH] 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 --- pcbnew/router/router_tool.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index f9ec861f9a..5f0217b649 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1205,13 +1205,17 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) for ( const auto p : mod->Pads() ) { auto solid = m_router->GetWorld()->FindItemByParent( p ); - itemsToDrag.Add( solid ); + + if( solid ) + itemsToDrag.Add( solid ); } } else { startItem = m_router->GetWorld()->FindItemByParent( static_cast( item ) ); - itemsToDrag.Add( startItem ); + + if( startItem) + itemsToDrag.Add( startItem ); } if( startItem && startItem->IsLocked() )