Handle uninitialized nets gracefully.

This commit is contained in:
Jeff Young 2020-01-15 19:40:20 +00:00
parent c98621691a
commit fe1b8c8888
1 changed files with 6 additions and 1 deletions

View File

@ -1150,7 +1150,12 @@ int BOARD::SortedNetnamesList( wxArrayString& aNames, bool aSortbyPadsCount )
padCountListByNet.assign( max_netcode + 1, 0 );
for( D_PAD* pad : pads )
padCountListByNet[pad->GetNetCode()]++;
{
int netCode = pad->GetNetCode();
if( netCode >= 0 )
padCountListByNet[ netCode ]++;
}
sort( netBuffer.begin(), netBuffer.end(), sortNetsByNodes );
}