pcbnew: fixing eagle_plugin with empty class names

Fixes #10229
https://gitlab.com/kicad/code/kicad/issues/10229
This commit is contained in:
Steffen Mauch 2022-01-03 15:55:57 +01:00 committed by Wayne Stambaugh
parent eeef65533a
commit a5307c6f59
1 changed files with 13 additions and 10 deletions

View File

@ -2484,17 +2484,20 @@ void EAGLE_PLUGIN::loadClasses( wxXmlNode* aClasses )
{
for( std::pair<const wxString&, ECOORD> entry : eClass.clearanceMap )
{
wxString rule;
rule.Printf( "(rule \"class %s:%s\"\n"
" (condition \"A.NetClass == '%s' && B.NetClass == '%s'\")\n"
" (constraint clearance (min %smm)))\n",
eClass.number,
entry.first,
eClass.name,
m_classMap[ entry.first ]->GetName(),
StringFromValue( EDA_UNITS::MILLIMETRES, entry.second.ToPcbUnits() ) );
if( m_classMap[ entry.first ] != nullptr )
{
wxString rule;
rule.Printf( "(rule \"class %s:%s\"\n"
" (condition \"A.NetClass == '%s' && B.NetClass == '%s'\")\n"
" (constraint clearance (min %smm)))\n",
eClass.number,
entry.first,
eClass.name,
m_classMap[ entry.first ]->GetName(),
StringFromValue( EDA_UNITS::MILLIMETRES, entry.second.ToPcbUnits() ) );
m_customRules += "\n" + rule;
m_customRules += "\n" + rule;
}
}
}