Fix bad dereference

Fixes https://gitlab.com/kicad/code/kicad/issues/7188
This commit is contained in:
Seth Hillbrand 2021-01-19 08:39:18 -08:00
parent 35978adef9
commit 4da28cf8f4
1 changed files with 4 additions and 2 deletions

View File

@ -281,16 +281,18 @@ void BACK_ANNOTATE::checkForUnusedSymbols()
// generate errors before we will find m_refs member to which item linked // generate errors before we will find m_refs member to which item linked
while( i < m_refs.GetCount() && m_refs[i].GetPath() != item.first.GetPath() ) while( i < m_refs.GetCount() && m_refs[i].GetPath() != item.first.GetPath() )
{ {
const SCH_REFERENCE& ref = m_refs[i++]; const SCH_REFERENCE& ref = m_refs[i];
if( ref.GetSymbol()->GetIncludeOnBoard() ) if( ref.GetSymbol()->GetIncludeOnBoard() )
{ {
wxString msg = wxString::Format( _( "Footprint '%s' is not present on PCB. " wxString msg = wxString::Format( _( "Footprint '%s' is not present on PCB. "
"Corresponding symbols in schematic must be " "Corresponding symbols in schematic must be "
"manually deleted (if desired)." ), "manually deleted (if desired)." ),
m_refs[i++].GetFullRef() ); m_refs[i].GetFullRef() );
m_reporter.ReportTail( msg, RPT_SEVERITY_WARNING ); m_reporter.ReportTail( msg, RPT_SEVERITY_WARNING );
} }
++i;
} }
++i; ++i;