Pcbnew: fix a serious bug: crashes when attempt to modify a zone that had lost its net (after eeschema changes for instance)
This commit is contained in:
parent
eae27b0baa
commit
8bfbdc8cf5
|
@ -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,6 +947,8 @@ 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 );
|
||||||
|
if( net ) // Should not occur, but ...
|
||||||
|
{
|
||||||
for( unsigned ii = net->m_RatsnestStartIdx; ii < net->m_RatsnestEndIdx; ii++ )
|
for( unsigned ii = net->m_RatsnestStartIdx; ii < net->m_RatsnestEndIdx; ii++ )
|
||||||
{
|
{
|
||||||
if( m_Pcb->m_FullRatsnest[ii].IsActive() )
|
if( m_Pcb->m_FullRatsnest[ii].IsActive() )
|
||||||
|
@ -955,6 +957,9 @@ void PCB_BASE_FRAME::TestNetConnection( wxDC* aDC, int aNetCode )
|
||||||
msg.Printf( wxT( "links %d nc %d net:nc %d" ),
|
msg.Printf( wxT( "links %d nc %d net:nc %d" ),
|
||||||
m_Pcb->GetRatsnestsCount(), m_Pcb->GetNoconnectCount(),
|
m_Pcb->GetRatsnestsCount(), m_Pcb->GetNoconnectCount(),
|
||||||
net_notconnected_count );
|
net_notconnected_count );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
msg.Printf( wxT( "net not found: netcode %d" ),aNetCode );
|
||||||
|
|
||||||
SetStatusText( msg );
|
SetStatusText( msg );
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue