Don't try and GetChar() on a empty field.

This commit is contained in:
Marek Roszko 2025-05-02 19:02:07 -04:00
parent 51377cbf41
commit 4b00114316

View File

@ -738,7 +738,8 @@ int SCH_SHEET::SymbolCount() const
{
SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
if( symbol->GetField( FIELD_T::VALUE )->GetText().GetChar( 0 ) != '#' )
wxString value = symbol->GetField( FIELD_T::VALUE )->GetText();
if( !value.empty() && value.GetChar( 0 ) != '#' )
n++;
}