Commit ec307ef6 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix a serious bug: crashes when attempt to modify a zone that had lost...

Pcbnew: fix a serious bug: crashes when attempt to modify a zone that had lost its net (after eeschema changes for instance)
parent 30fa7158
...@@ -897,7 +897,7 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) ...@@ -897,7 +897,7 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode )
{ {
wxString msg; wxString msg;
if( aNetCode == 0 ) if( aNetCode <= 0 ) // -1 = not existing net, 0 = dummy net
return; return;
if( (m_Pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 ) if( (m_Pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 )
...@@ -947,14 +947,19 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode ) ...@@ -947,14 +947,19 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode )
/* Display results */ /* Display results */
int net_notconnected_count = 0; int net_notconnected_count = 0;
NETINFO_ITEM* net = m_Pcb->FindNet( aNetCode ); NETINFO_ITEM* net = m_Pcb->FindNet( aNetCode );
for( unsigned ii = net->m_RatsnestStartIdx; ii < net->m_RatsnestEndIdx; ii++ ) if( net ) // Should not occur, but ...
{ {
if( m_Pcb->m_FullRatsnest[ii].IsActive() ) for( unsigned ii = net->m_RatsnestStartIdx; ii < net->m_RatsnestEndIdx; ii++ )
net_notconnected_count++; {
if( m_Pcb->m_FullRatsnest[ii].IsActive() )
net_notconnected_count++;
}
msg.Printf( wxT( "links %d nc %d net:nc %d" ),
m_Pcb->GetRatsnestsCount(), m_Pcb->GetNoconnectCount(),
net_notconnected_count );
} }
msg.Printf( wxT( "links %d nc %d net:nc %d" ), else
m_Pcb->GetRatsnestsCount(), m_Pcb->GetNoconnectCount(), msg.Printf( wxT( "net not found: netcode %d" ),aNetCode );
net_notconnected_count );
SetStatusText( msg ); SetStatusText( msg );
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment