Don't use canonical name for user fields with an id of -1.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16715
This commit is contained in:
Jeff Young 2024-01-23 13:41:26 +00:00
parent 8b56b3d999
commit 179ab1011f
1 changed files with 1 additions and 1 deletions

View File

@ -1033,7 +1033,7 @@ wxString SCH_FIELD::GetCanonicalName() const
{
if( m_parent && m_parent->Type() == SCH_SYMBOL_T )
{
if( m_id < MANDATORY_FIELDS )
if( m_id >= 0 && m_id < MANDATORY_FIELDS )
return GetCanonicalFieldName( m_id );
else
return m_name;