zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5d5128b22620f0e75c0ff5514e93551e1bd84325

commit 5d5128b22620f0e75c0ff5514e93551e1bd84325
Author: Marcel Hollerbach <[email protected]>
Date:   Wed Sep 11 13:38:48 2019 -0400

    efl_ui_collection: fix the insertion of the first element with pack_at
    
    Summary:
    before pack_at with no element failed because the list element has been
    NULL.
    This fixes the insertion, the codepath also works without the error.
    Depends on D9871
    
    Reviewers: zmike, cedric
    
    Reviewed By: zmike
    
    Subscribers: #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D9890
---
 src/lib/elementary/efl_ui_collection.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_collection.c 
b/src/lib/elementary/efl_ui_collection.c
index 32811bc001..2a666f2090 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -854,7 +854,8 @@ _efl_ui_collection_efl_pack_linear_pack_at(Eo *obj, 
Efl_Ui_Collection_Data *pd,
    clamp = clamp_index(pd, index);
    index = index_adjust(pd, index);
    subobj_list = eina_list_nth_list(pd->items, index);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(subobj_list, EINA_FALSE);
+   if (pd->items)
+     EINA_SAFETY_ON_NULL_RETURN_VAL(subobj_list, EINA_FALSE);
    if (!register_item(obj, pd, subobj))
      return EINA_FALSE;
    if (clamp == 0)

-- 


Reply via email to