Elementary widget: Fixed NULL checking in elm_widget_show_region_set
[framework/uifw/elementary.git] / src / lib / elm_widget.c
index 6c448fd..6d766bb 100644 (file)
@@ -1589,11 +1589,9 @@ elm_widget_focus_steal(Evas_Object *obj)
      {
        parent = elm_widget_parent_get(parent);
        sd = evas_object_smart_data_get(parent);
-       if (elm_widget_focus_get(sd->resize_obj))
-          {
-             elm_widget_focused_object_clear(sd->resize_obj);
-          }
-       else
+        if ((sd->resize_obj) && (elm_widget_focus_get(sd->resize_obj)))
+          elm_widget_focused_object_clear(sd->resize_obj);
+        else
          {
             const Eina_List *l;
             Evas_Object *child;
@@ -1676,10 +1674,10 @@ elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Co
    do
      {
         parent_obj = sd->parent_obj;
-        child_obj = sd->obj;
+        if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break;
         sd = evas_object_smart_data_get(parent_obj);
-
-        if ((!parent_obj) || (!sd) || (!_elm_widget_is(parent_obj))) break;
+        if (!sd) break;
+        child_obj = sd->obj;
 
         evas_object_geometry_get(parent_obj, &px, &py, NULL, NULL);
         evas_object_geometry_get(child_obj, &cx, &cy, NULL, NULL);
@@ -2537,7 +2535,11 @@ _newest_focus_order_get(Evas_Object *obj, unsigned int *newest_focus_order, Eina
         if (!ret) continue;
         best = ret;
      }
-   if ((can_focus_only) && (!elm_widget_can_focus_get(best))) return NULL;
+   if (can_focus_only)
+     {
+        if ((!best) || (!elm_widget_can_focus_get(best)))
+         return NULL;
+     }
    return best;
 }