From 8709e69bcc588b8a95844992c9b03478591925f9 Mon Sep 17 00:00:00 2001 From: cajun Date: Sat, 28 Sep 2024 14:23:46 -0500 Subject: [PATCH] prevent empty list crash on windows (fixes #93) (#94) Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com> --- src/gui/control/item_list.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/control/item_list.cpp b/src/gui/control/item_list.cpp index 83dc0437..e3521003 100644 --- a/src/gui/control/item_list.cpp +++ b/src/gui/control/item_list.cpp @@ -180,10 +180,10 @@ void ItemList::refreshList(bool refresh_current_only) { // refresh // Note: Freeze/Thaw makes flicker worse long item_count = (long)sorted_list.size(); + SetItemCount(item_count); if (item_count == 0) { Refresh(); } else { - SetItemCount(item_count); // (re)select current item findSelectedItemPos(); focusNone();