schematic: fix crash in search pane when hit list is empty

std::all_of also returns true for an empty set
This commit is contained in:
Mike Williams 2023-05-29 09:50:09 -04:00
parent 2612b49698
commit 7f250870fe
1 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ void SCH_SEARCH_HANDLER::SelectItems( std::vector<long>& 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;
}
}