Browse Source

Nullptr safety. (Sentry KICAD-5N)

7.0
Jeff Young 3 years ago
parent
commit
f90b04c715
  1. 39
      pcbnew/exporters/export_gencad.cpp

39
pcbnew/exporters/export_gencad.cpp

@ -935,32 +935,35 @@ static void CreateSignalsSection( FILE* aFile, BOARD* aPcb )
{
net = aPcb->FindNet( ii );
if( net->GetNetname() == wxEmptyString ) // dummy netlist (no connection)
if( net )
{
msg.Printf( wxT( "NoConnection%d" ), NbNoConn++ );
}
if( net->GetNetname() == wxEmptyString ) // dummy netlist (no connection)
{
msg.Printf( wxT( "NoConnection%d" ), NbNoConn++ );
}
if( net->GetNetCode() <= 0 ) // dummy netlist (no connection)
continue;
if( net->GetNetCode() <= 0 ) // dummy netlist (no connection)
continue;
msg = wxT( "SIGNAL \"" ) + escapeString( net->GetNetname() ) + wxT( "\"" );
msg = wxT( "SIGNAL \"" ) + escapeString( net->GetNetname() ) + wxT( "\"" );
fputs( TO_UTF8( msg ), aFile );
fputs( "\n", aFile );
fputs( TO_UTF8( msg ), aFile );
fputs( "\n", aFile );
for( FOOTPRINT* footprint : aPcb->Footprints() )
{
for( PAD* pad : footprint->Pads() )
for( FOOTPRINT* footprint : aPcb->Footprints() )
{
if( pad->GetNetCode() != net->GetNetCode() )
continue;
for( PAD* pad : footprint->Pads() )
{
if( pad->GetNetCode() != net->GetNetCode() )
continue;
msg.Printf( wxT( "NODE \"%s\" \"%s\"" ),
escapeString( footprint->GetReference() ),
escapeString( pad->GetNumber() ) );
msg.Printf( wxT( "NODE \"%s\" \"%s\"" ),
escapeString( footprint->GetReference() ),
escapeString( pad->GetNumber() ) );
fputs( TO_UTF8( msg ), aFile );
fputs( "\n", aFile );
fputs( TO_UTF8( msg ), aFile );
fputs( "\n", aFile );
}
}
}
}

Loading…
Cancel
Save