From b608ebd0587e08e9e637c52f1a8502de69b2bc89 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 18 Jan 2022 18:59:04 +0000 Subject: [PATCH] Don't findnext on an empty string; show the dialog. Fixes https://gitlab.com/kicad/code/kicad/issues/10313 (cherry picked from commit 60fc75e2399a61c69d71b7b71dc1e41baf09eb32) --- pcbnew/dialogs/dialog_find.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index 4285dd8e1c..ccfae7fc6f 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -129,8 +129,15 @@ void DIALOG_FIND::search( bool aDirection ) bool endIsReached = false; bool isFirstSearch = false; - // Add/move the search string to the top of the list if it isn't already there searchString = m_searchCombo->GetValue(); + + if( searchString.IsEmpty() ) + { + Show(); + return; + } + + // Add/move the search string to the top of the list if it isn't already there index = m_searchCombo->FindString( searchString, true ); if( index == wxNOT_FOUND )