From f2c940fd1e766685ff936046c35ef2ea48e96723 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 23 Nov 2022 21:20:14 +0100 Subject: [PATCH] Fix crash when adding cinemas while a search is in force (#2378). --- src/wx/screens_panel.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index b7defe0e9..1d94d1acb 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -249,7 +249,12 @@ ScreensPanel::add_cinema_clicked () wxTreeListItem previous = wxTLI_FIRST; bool found = false; + auto search = wx_to_std(_search->GetValue()); + convert_to_lower(search); for (auto existing_cinema: cinemas) { + if (!matches_search(existing_cinema, search)) { + continue; + } if (_collator.compare(dialog->name(), existing_cinema->name) < 0) { /* existing_cinema should be after the one we're inserting */ found = true; -- 2.30.2