diff --git a/pcbnew/ratsnest_data.cpp b/pcbnew/ratsnest_data.cpp index 96783c6027..be195484db 100644 --- a/pcbnew/ratsnest_data.cpp +++ b/pcbnew/ratsnest_data.cpp @@ -1069,7 +1069,7 @@ void RN_NET::processPads() bool RN_DATA::Add( const BOARD_ITEM* aItem ) { - int net; + int net = NETINFO_LIST::ORPHANED; if( aItem->IsConnected() ) { @@ -1112,6 +1112,12 @@ bool RN_DATA::Add( const BOARD_ITEM* aItem ) return true; } + if( net == NETINFO_LIST::ORPHANED ) + return false; + + // If the netcode is set, it should be valid for indexing into vector + assert( net < (int) m_nets.size() ); + switch( aItem->Type() ) { case PCB_PAD_T: