From 4902ab9fe3e78ec832fc4227fbda13bc51037234 Mon Sep 17 00:00:00 2001 From: Hubert Stachowiak Date: Mon, 4 Sep 2023 14:24:10 +0200 Subject: [PATCH] efl_ui_widget: Add null checks in _efl_ui_widget_focus_steal Change-Id: I5bd04962eda6f4161012ca70dbaeff73a467aa8a --- src/lib/elementary/efl_ui_widget.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 8317aff..95580c3 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -10406,18 +10406,27 @@ _efl_ui_widget_focus_steal(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item * { Evas_Object *parent, *parent2, *o; - if (sd->focused) return; - if (sd->disabled) return; - if (!sd->can_focus) return; - if (sd->tree_unfocusable) return; + //TIZEN_ONLY(20230904) efl_ui_widget: Add null checks in _efl_ui_widget_focus_steal + if (sd) + { + if (sd->focused) return; + if (sd->disabled) return; + if (!sd->can_focus) return; + if (sd->tree_unfocusable) return; + } + EINA_SAFETY_ON_NULL_RETURN(obj); parent = obj; for (;; ) { o = elm_widget_parent_get(parent); if (!o) break; sd = efl_data_scope_get(o, MY_CLASS); - if (sd->disabled || sd->tree_unfocusable) return; - if (sd->focused) break; + if (sd) + { + if (sd->disabled || sd->tree_unfocusable) return; + if (sd->focused) break; + } + // parent = o; } if ((!elm_widget_parent_get(parent))) -- 2.7.4