Pcbnew: Fix crash when importing a netlist created by a 5.1 Eeschema version.

Fixes #8293
https://gitlab.com/kicad/code/kicad/issues/8293
This commit is contained in:
jean-pierre charras 2021-04-25 15:13:42 +02:00
parent eb85836234
commit 93d42e9902
2 changed files with 5 additions and 2 deletions

View File

@ -305,7 +305,9 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint,
// Test for time stamp change.
KIID_PATH new_path = aNetlistComponent->GetPath();
new_path.push_back( aNetlistComponent->GetKIIDs().front() );
if( !aNetlistComponent->GetKIIDs().empty() )
new_path.push_back( aNetlistComponent->GetKIIDs().front() );
if( aPcbFootprint->GetPath() != new_path )
{

View File

@ -42,7 +42,8 @@ void COMPONENT::SetFootprint( FOOTPRINT* aFootprint )
m_footprint.reset( aFootprint );
KIID_PATH path = m_path;
path.push_back( m_kiids.front() );
if( !m_kiids.empty() )
path.push_back( m_kiids.front() );
if( aFootprint == NULL )
return;