efl_ui_widget: Add null checks in _efl_ui_widget_focus_steal 69/298269/3 accepted/tizen/unified/20230912.171632
authorHubert Stachowiak <h.stachowiak@samsung.com>
Mon, 4 Sep 2023 12:24:10 +0000 (14:24 +0200)
committerChun <jykeon@samsung.com>
Tue, 12 Sep 2023 01:34:25 +0000 (01:34 +0000)
Change-Id: I5bd04962eda6f4161012ca70dbaeff73a467aa8a

src/lib/elementary/efl_ui_widget.c

index 8317aff..95580c3 100644 (file)
@@ -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)))