summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-11-23 21:20:14 +0100
committerCarl Hetherington <cth@carlh.net>2022-11-23 21:23:25 +0100
commitf2c940fd1e766685ff936046c35ef2ea48e96723 (patch)
tree1e8d4ceed6b529c3aba2e60fa9bac8894490f019 /src
parent493ed4867d46e03a08905dd7a938a90c3262b58f (diff)
Fix crash when adding cinemas while a search is in force (#2378).
Diffstat (limited to 'src')
-rw-r--r--src/wx/screens_panel.cc5
1 files changed, 5 insertions, 0 deletions
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;