From 7f250870fef21854aee815538b69758f3ffe3663 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 29 May 2023 09:50:09 -0400 Subject: [PATCH] schematic: fix crash in search pane when hit list is empty std::all_of also returns true for an empty set --- eeschema/widgets/search_handlers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eeschema/widgets/search_handlers.cpp b/eeschema/widgets/search_handlers.cpp index 998c485ac0..d2a49505f8 100644 --- a/eeschema/widgets/search_handlers.cpp +++ b/eeschema/widgets/search_handlers.cpp @@ -93,7 +93,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector& aItemRows ) m_frame->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); - if( allHitsOnSamePage ) + if( allHitsOnSamePage && !selectedHits.empty() ) { m_frame->SetCurrentSheet( *selectedHits.front().sheetPath ); m_frame->DisplayCurrentSheet(); @@ -349,4 +349,4 @@ wxString LABEL_SEARCH_HANDLER::GetResultCell( int aRow, int aCol ) return m_frame->MessageTextFromValue( lbl->GetPosition().y ); return wxEmptyString; -} \ No newline at end of file +}