Fix crash when running PNS Router Dump (pressing 0)

Some ITEMs don't have a Parent
This commit is contained in:
Roberto Fernandez Bautista 2023-08-23 22:19:47 +02:00
parent 196fc67ece
commit f4f1ca352a
1 changed files with 3 additions and 1 deletions

View File

@ -290,8 +290,10 @@ const std::string ITEM::Format() const
std::stringstream ss;
ss << KindStr() << " ";
if( Parent()->IsConnected() )
if( Parent() && Parent()->IsConnected() )
ss << "net " << static_cast<BOARD_CONNECTED_ITEM*>( Parent() )->GetNetCode() << " ";
else
ss << "net " << Net() << " ";
ss << "layers " << m_layers.Start() << " " << m_layers.End();
return ss.str();