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
This commit is contained in:
Marcel Hollerbach 2019-09-11 13:38:48 -04:00 committed by Mike Blumenkrantz
parent ad6300aa48
commit 5d5128b226
1 changed files with 2 additions and 1 deletions

View File

@ -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)