From 4be6a27a396dfc76fda838a479c5a4dc8bfc5709 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 3 Nov 2020 18:25:05 +0000 Subject: [PATCH] Report error when pin for backannotate can't be found. Fixes https://gitlab.com/kicad/code/kicad/issues/6263 --- eeschema/tools/backannotate.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/backannotate.cpp b/eeschema/tools/backannotate.cpp index f1d0b63aa9..0fabca2e89 100644 --- a/eeschema/tools/backannotate.cpp +++ b/eeschema/tools/backannotate.cpp @@ -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();