From 11117a2d9a36d5f1af64a8d56f79cc7c5f4712b2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 17 Dec 2020 14:18:27 +0000 Subject: [PATCH] Fix invalid access into empty string. --- eeschema/sch_text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index efa7e7368c..592d4d769b 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -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(); }