Fix invalid access into empty string.

This commit is contained in:
Jeff Young 2020-12-17 14:18:27 +00:00
parent a6085fa88d
commit 11117a2d9a
1 changed files with 1 additions and 1 deletions

View File

@ -1145,7 +1145,7 @@ bool SCH_GLOBALLABEL::ResolveTextVar( wxString* token, int aDepth ) const
for( const wxString& pageNo : pageListCopy )
token->Append( wxString::Format( wxT( "%s," ), pageNo ) );
if( token->Last() == ',' )
if( !token->IsEmpty() && token->Last() == ',' )
token->RemoveLast();
}