Don't log a potentially invalidated item

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9006
This commit is contained in:
Jon Evans 2021-08-21 12:24:41 -04:00
parent 0814219513
commit 09ea630d8e
1 changed files with 5 additions and 2 deletions

View File

@ -974,11 +974,14 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
m_lastTargetLayer = targetLayer;
if( m_router->RoutingInProgress() )
{
updateEndItem( aEvent );
m_router->Move( m_endSnapPoint, m_endItem );
}
else
{
updateStartItem( aEvent );
m_router->Move( m_endSnapPoint, m_endItem ); // refresh
}
return 0;
}