Commit 386d1fc2 authored by Maciej Suminski's avatar Maciej Suminski

Made two functions immune to empty containers.

parent 487b609e
......@@ -70,7 +70,10 @@ public:
void MIN_SPAN_TREE_PADS::AddTreeToRatsnest( std::vector<RATSNEST_ITEM> &aRatsnestList )
{
std::vector<D_PAD*> & padsBuffer = *m_PadsList;
std::vector<D_PAD*>& padsBuffer = *m_PadsList;
if( padsBuffer.empty() )
return;
int netcode = padsBuffer[0]->GetNet();
// Note: to get edges in minimum spanning tree,
// the index value 0 is not used: it is just
......
......@@ -240,7 +240,7 @@ void RN_NET::compute()
return;
}
else if( boardNodes.size() == 1 ) // This case is even simpler
else if( boardNodes.size() == 1 || boardNodes.empty() ) // This case is even simpler
{
m_rnEdges.reset( new std::vector<RN_EDGE_PTR>( 0 ) );
......
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