Fix segfault on BOARDs without tracks
This commit is contained in:
parent
18b7dbf4d1
commit
8dcf040a4e
|
@ -143,15 +143,19 @@ void BOARD::Test_Connections_To_Copper_Areas( int aNetcode )
|
||||||
for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ )
|
for( unsigned ii = 0; ii < net->m_PadInNetList.size(); ii++ )
|
||||||
candidates.push_back( net->m_PadInNetList[ii] );
|
candidates.push_back( net->m_PadInNetList[ii] );
|
||||||
|
|
||||||
// Build the list of track candidates connected to the net:
|
// If we have any tracks...
|
||||||
TRACK* track = m_Track.GetFirst()->GetStartNetCode( netcode );
|
if( m_Track.GetCount() > 0 )
|
||||||
|
|
||||||
for( ; track; track = track->Next() )
|
|
||||||
{
|
{
|
||||||
if( track->GetNetCode() != netcode )
|
// Build the list of track candidates connected to the net:
|
||||||
break;
|
TRACK* track = m_Track.GetFirst()->GetStartNetCode( netcode );
|
||||||
|
|
||||||
candidates.push_back( track );
|
for( ; track; track = track->Next() )
|
||||||
|
{
|
||||||
|
if( track->GetNetCode() != netcode )
|
||||||
|
break;
|
||||||
|
|
||||||
|
candidates.push_back( track );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,12 +311,18 @@ void Merge_SubNets_Connected_By_CopperAreas( BOARD* aPcb, int aNetcode )
|
||||||
|
|
||||||
// Build the list of track candidates connected to the net:
|
// Build the list of track candidates connected to the net:
|
||||||
TRACK* track;
|
TRACK* track;
|
||||||
track = aPcb->m_Track.GetFirst()->GetStartNetCode( aNetcode );
|
|
||||||
for( ; track; track = track->Next() )
|
if( aPcb->m_Track.GetCount() > 0 )
|
||||||
{
|
{
|
||||||
if( track->GetNetCode() != aNetcode )
|
track = aPcb->m_Track.GetFirst()->GetStartNetCode( aNetcode );
|
||||||
break;
|
|
||||||
Candidates.push_back( track );
|
for( ; track; track = track->Next() )
|
||||||
|
{
|
||||||
|
if( track->GetNetCode() != aNetcode )
|
||||||
|
break;
|
||||||
|
|
||||||
|
Candidates.push_back( track );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( Candidates.size() == 0 )
|
if( Candidates.size() == 0 )
|
||||||
|
|
Loading…
Reference in New Issue