This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository evisum.

View the commit online.

commit 7d220cd6752cc588842666a6ee9947377c911725
Author: Alastair Poole <[email protected]>
AuthorDate: Sat Mar 28 05:53:51 2026 +0000

    widget: guard more carefully
---
 src/bin/ui/evisum_ui_widget_exel.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/src/bin/ui/evisum_ui_widget_exel.c b/src/bin/ui/evisum_ui_widget_exel.c
index e1ec6da..2dae011 100644
--- a/src/bin/ui/evisum_ui_widget_exel.c
+++ b/src/bin/ui/evisum_ui_widget_exel.c
@@ -76,6 +76,13 @@ _evisum_ui_widget_exel_field_get(const Evisum_Ui_Widget_Exel *wx, int id) {
     return (Exel_Field *) &wx->fields[id];
 }
 
+static Eina_Bool
+_evisum_ui_widget_exel_field_id_valid(const Evisum_Ui_Widget_Exel *wx, int id) {
+    if (!wx) return EINA_FALSE;
+    if (id < 0 || id >= EVISUM_UI_WIDGET_EXEL_FIELDS_MAX) return EINA_FALSE;
+    return EINA_TRUE;
+}
+
 static int
 _evisum_ui_widget_exel_field_prev_visible_get(const Evisum_Ui_Widget_Exel *wx, int id) {
     int i;
@@ -140,6 +147,7 @@ _evisum_ui_widget_exel_dirty_get(Evisum_Ui_Widget_Exel *wx) {
     unsigned int ref;
 
     if (!wx->p.reference_mask_get_cb) return wx->fields_changed;
+    if (!wx->p.fields_mask) return wx->fields_changed;
 
     ref = wx->p.reference_mask_get_cb(wx->p.data);
     return ref != *(wx->p.fields_mask);
@@ -147,6 +155,7 @@ _evisum_ui_widget_exel_dirty_get(Evisum_Ui_Widget_Exel *wx) {
 
 static void
 _evisum_ui_widget_exel_fields_changed_notify(Evisum_Ui_Widget_Exel *wx) {
+    if (!wx) return;
     wx->fields_changed = _evisum_ui_widget_exel_dirty_get(wx);
     if (wx->p.fields_changed_cb) wx->p.fields_changed_cb(wx->p.data, wx->fields_changed);
 }
@@ -195,13 +204,14 @@ _evisum_ui_widget_exel_fields_menu_check_changed_cb(void *data, Evas_Object *obj
     Evas_Object *ic;
 
     wx = evas_object_data_get(obj, "wx");
-    if (!wx || !f) return;
+    if (!wx || !f || !wx->p.fields_mask) return;
 
     *(wx->p.fields_mask) ^= (1U << f->id);
     _evisum_ui_widget_exel_fields_sync(wx);
     _evisum_ui_widget_exel_fields_changed_notify(wx);
 
     ic = evas_object_data_get(obj, "apply_icon");
+    if (!ic) return;
     if (!wx->fields_changed) evas_object_hide(ic);
     else evas_object_show(ic);
 }
@@ -287,6 +297,7 @@ _evisum_ui_widget_exel_field_header_mouse_down_cb(void *data, Evas *e EINA_UNUSE
     Evas_Coord x, w;
     int field, prev;
 
+    if (!wx || !obj || !ev) return;
     if (ev->button != 1) return;
 
     evas_object_geometry_get(obj, &x, NULL, &w, NULL);
@@ -642,6 +653,7 @@ evisum_ui_widget_exel_field_width_apply(Evisum_Ui_Widget_Exel *wx, int id) {
     int width;
 
     if (!wx) return;
+    if (!_evisum_ui_widget_exel_field_id_valid(wx, id) || !wx->p.field_widths) return;
 
     {
         Exel_Field *f = _evisum_ui_widget_exel_field_get(wx, id);
@@ -689,6 +701,7 @@ evisum_ui_widget_exel_cmd_width_sync(Evisum_Ui_Widget_Exel *wx, int field_cmd_id
     int minw;
 
     if (!wx) return;
+    if (!_evisum_ui_widget_exel_field_id_valid(wx, field_cmd_id) || !wx->p.field_widths) return;
 
     minw = _evisum_ui_widget_exel_field_min_width_get(wx, field_cmd_id);
     if (width < minw) width = minw;
@@ -715,6 +728,7 @@ _evisum_ui_widget_exel_field_resize_mouse_move(Evisum_Ui_Widget_Exel *wx, Evas_E
 
     if (!wx || !ev) return;
     if (!wx->resizing || !wx->resize_btn) return;
+    if (!_evisum_ui_widget_exel_field_id_valid(wx, wx->resize_field) || !wx->p.field_widths) return;
 
     width = wx->resize_start_w + (wx->resize_dir * (ev->cur.canvas.x - wx->resize_start_x));
     if (width < _evisum_ui_widget_exel_field_min_width_get(wx, wx->resize_field))
@@ -743,6 +757,11 @@ evisum_ui_widget_exel_field_resize_mouse_up(Evisum_Ui_Widget_Exel *wx, Evas_Even
     if (!wx || !ev) return;
     if (ev->button != 1) return;
     if (!wx->resizing || !wx->resize_btn) return;
+    if (!_evisum_ui_widget_exel_field_id_valid(wx, wx->resize_field) || !wx->p.field_widths) {
+        wx->resizing = 0;
+        wx->resize_btn = NULL;
+        return;
+    }
 
     evas_object_geometry_get(wx->resize_btn, NULL, NULL, &w, NULL);
     wx->p.field_widths[wx->resize_field] = w;
@@ -779,6 +798,10 @@ evisum_ui_widget_exel_fields_menu_show(Evisum_Ui_Widget_Exel *wx, Evas_Object *a
     evas_object_geometry_get(anchor_btn, &ox, &oy, &ow, &oh);
 
     o = wx->fields_menu = _evisum_ui_widget_exel_fields_menu_create(wx);
+    if (!o) {
+        wx->fields_menu = NULL;
+        return;
+    }
     elm_ctxpopup_direction_priority_set(o, ELM_CTXPOPUP_DIRECTION_DOWN, ELM_CTXPOPUP_DIRECTION_UP,
                                         ELM_CTXPOPUP_DIRECTION_LEFT, ELM_CTXPOPUP_DIRECTION_RIGHT);
     evas_object_move(o, ox + (ow / 2), oy + oh);
@@ -1083,6 +1106,7 @@ evisum_ui_widget_exel_item_column_width_apply(Evas_Object *obj, Evas_Coord width
 
 static void
 _evisum_ui_widget_exel_glist_ensure_n_items(Evas_Object *glist, unsigned int items, Elm_Genlist_Item_Class *itc) {
+    if (!glist || !itc) return;
     Elm_Object_Item *it;
     unsigned int i, existing = elm_genlist_items_count(glist);
 
@@ -1106,6 +1130,7 @@ evisum_ui_widget_exel_menu_item_add(Evas_Object *menu, Elm_Object_Item *parent,
     Evas_Object *ic;
     Elm_Object_Item *it;
 
+    if (!menu) return NULL;
     if (!icon) return elm_menu_item_add(menu, parent, NULL, label, func, data);
 
     it = elm_menu_item_add(menu, parent, NULL, label, func, data);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to