Fix crash when nonexistent string entered when filtering keywords

This commit is contained in:
Luke Le Moignan
2022-12-29 02:02:03 +00:00
parent 4c9e6fc735
commit 1b88d905b1
2 changed files with 8 additions and 3 deletions
+4 -3
View File
@@ -180,15 +180,16 @@ void ItemList::refreshList(bool refresh_current_only) {
// refresh
// Note: Freeze/Thaw makes flicker worse
long item_count = (long)sorted_list.size();
if (item_count == 0) {
Refresh();
} else {
SetItemCount(item_count);
// (re)select current item
findSelectedItemPos();
focusNone();
focusSelectedItem(true);
// refresh items
if (item_count == 0) {
Refresh();
} else {
RefreshItems(0, item_count - 1);
}
}