Report error when pin for backannotate can't be found.

Fixes https://gitlab.com/kicad/code/kicad/issues/6263
This commit is contained in:
Jeff Young 2020-11-03 18:25:05 +00:00
parent d467c7c6d4
commit 4be6a27a39
1 changed files with 12 additions and 1 deletions

View File

@ -370,7 +370,18 @@ void BACK_ANNOTATE::applyChangelist()
const wxString& pinNumber = entry.first;
const wxString& shortNetName = entry.second;
SCH_PIN* pin = comp->GetPin( pinNumber );
SCH_CONNECTION* conn = pin ? pin->Connection( &ref.GetSheetPath() ) : nullptr;
if( !pin )
{
msg.Printf( _( "Cannot find \"%s\" pin \"%s\"." ),
ref.GetFullRef(),
pinNumber );
m_reporter.ReportHead( msg, RPT_SEVERITY_ERROR );
continue;
}
SCH_CONNECTION* conn = pin->Connection( &ref.GetSheetPath() );
wxString key = shortNetName + ref.GetSheetPath().PathAsString();