Fix crash when not wrapping search

The iterator at the end of the search is already set the end(), so we
cannot increment it safely
This commit is contained in:
Seth Hillbrand 2020-09-24 15:57:04 -07:00
parent d535a4b833
commit 9937f52f06
1 changed files with 3 additions and 3 deletions

View File

@ -284,7 +284,7 @@ void DIALOG_FIND::search( bool aDirection )
{
m_frame->SetStatusText( wxEmptyString );
}
else
else if( m_it != m_hitList.end() )
{
if( aDirection )
{
@ -297,7 +297,7 @@ void DIALOG_FIND::search( bool aDirection )
else
{
m_frame->SetStatusText( wxEmptyString );
m_frame->ShowInfoBarMsg( _( "No more item to show" ) );
m_frame->ShowInfoBarMsg( _( "No more items to show" ) );
return;
}
}
@ -313,7 +313,7 @@ void DIALOG_FIND::search( bool aDirection )
else
{
m_frame->SetStatusText( wxEmptyString );
m_frame->ShowInfoBarMsg( _( "No more item to show" ) );
m_frame->ShowInfoBarMsg( _( "No more items to show" ) );
return;
}
}