efl_ui/box: restore previous behavior for passing null reference objects
authorMike Blumenkrantz <zmike@samsung.com>
Fri, 6 Sep 2019 16:43:32 +0000 (12:43 -0400)
committerYeongjong Lee <yj34.lee@samsung.com>
Mon, 16 Sep 2019 01:23:00 +0000 (10:23 +0900)
Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9865

src/lib/elementary/efl_ui_box.c

index 125c8e3..9687006 100644 (file)
@@ -281,7 +281,7 @@ _efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Ent
 EOLIAN static Eina_Bool
 _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
 {
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE);
+   if (existing) EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE);
 
    if (!_efl_ui_box_child_register(obj, pd, subobj))
      return EINA_FALSE;
@@ -294,7 +294,7 @@ _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_En
 EOLIAN static Eina_Bool
 _efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
 {
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE);
+   if (existing) EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, existing), EINA_FALSE);
 
    if (!_efl_ui_box_child_register(obj, pd, subobj))
      return EINA_FALSE;