ui/common/types.c

changeset 737
ac7f0869e8ae
parent 728
011d236c4a05
child 757
2b977b332582
--- a/ui/common/types.c	Sat Aug 30 10:14:46 2025 +0200
+++ b/ui/common/types.c	Sat Aug 30 10:18:09 2025 +0200
@@ -627,10 +627,12 @@
 }
 
 UIEXPORT void ui_list_setselection(UiList *list, int index) {
-    if (list->setselection && index >= 0) {
-        UiListSelection sel;
-        sel.count = 1;
-        sel.rows = &index;
+    if (list->setselection) {
+        UiListSelection sel = { 0, NULL };
+        if(index >= 0) {
+            sel.count = 1;
+            sel.rows = &index;
+        }
         list->setselection(list, sel);
     }
 }

mercurial