From 8a0384e2f6db846029c47e11faff3fb07adffa16 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 15 Sep 2022 17:52:57 +0200 Subject: [PATCH] crossprobing pcb->schematic: handle correctly empty sheets. (filtering selection candidates was not made for empty sheets) Fixes #12427 https://gitlab.com/kicad/code/kicad/issues/12427 --- eeschema/cross-probing.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eeschema/cross-probing.cpp b/eeschema/cross-probing.cpp index 531c56cd63..c24f3b0c34 100644 --- a/eeschema/cross-probing.cpp +++ b/eeschema/cross-probing.cpp @@ -553,6 +553,12 @@ bool sheetContainsOnlyWantedItems( SCH_REFERENCE_LIST references; aSheetPath.GetSymbols( references, false, true ); + if( references.GetCount() == 0 ) // Empty sheet, obviously do not contain wanted items + { + aCache.emplace( aSheetPath, false ); + return false; + } + for( unsigned ii = 0; ii < references.GetCount(); ii++ ) { SCH_REFERENCE& schRef = references[ii];