From 5d5128b22620f0e75c0ff5514e93551e1bd84325 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 11 Sep 2019 13:38:48 -0400 Subject: [PATCH] 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)