Fix nullptr error.
This commit is contained in:
parent
f6e238dc3f
commit
891583f616
|
@ -505,10 +505,13 @@ bool ROUTER_TOOL::Init()
|
|||
[&]( const SELECTION& )
|
||||
{
|
||||
std::vector<PNS::NET_HANDLE> currentNets = m_router->GetCurrentNets();
|
||||
NETINFO_ITEM* netInfo = static_cast<NETINFO_ITEM*>( currentNets[0] );
|
||||
|
||||
if( currentNets.empty() || currentNets[0] == nullptr )
|
||||
return false;
|
||||
|
||||
// Need to have something unconnected to finish to
|
||||
int currentNet = netInfo ? netInfo->GetNetCode() : -1;
|
||||
NETINFO_ITEM* netInfo = static_cast<NETINFO_ITEM*>( currentNets[0] );
|
||||
int currentNet = netInfo->GetNetCode();
|
||||
BOARD* board = getEditFrame<PCB_EDIT_FRAME>()->GetBoard();
|
||||
RN_NET* ratsnest = board->GetConnectivity()->GetRatsnestForNet( currentNet );
|
||||
|
||||
|
|
Loading…
Reference in New Issue