EAGLE import: fix crash when loading unknown signal class name.

Fixes KICAD-3FA
This commit is contained in:
Alex Shvartzkop 2023-08-25 23:05:26 +03:00
parent bfb6269f0a
commit 0fcf9e2c7d
1 changed files with 8 additions and 7 deletions

View File

@ -2619,15 +2619,16 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
if( net->HasAttribute( "class" ) )
{
netclass = m_classMap[ net->GetAttribute( "class" ) ];
auto netclassIt = m_classMap.find( net->GetAttribute( "class" ) );
m_board->GetDesignSettings().m_NetSettings->m_NetClassPatternAssignments.push_back(
{
std::make_unique<EDA_COMBINED_MATCHER>( netName, CTX_NETCLASS ),
netclass->GetName()
} );
if( netclassIt != m_classMap.end() )
{
m_board->GetDesignSettings().m_NetSettings->m_NetClassPatternAssignments.push_back(
{ std::make_unique<EDA_COMBINED_MATCHER>( netName, CTX_NETCLASS ),
netclassIt->second->GetName() } );
netInfo->SetNetClass( netclass );
netInfo->SetNetClass( netclassIt->second );
}
}
m_board->Add( netInfo );