elementary: add safety check to prevent some ill request.

SVN revision: 60261
This commit is contained in:
Cedric BAIL 2011-06-13 07:43:11 +00:00
parent cb70c3fe3d
commit fda013920d
1 changed files with 3 additions and 0 deletions

View File

@ -3765,6 +3765,9 @@ elm_genlist_item_insert_after(Evas_Object *obj,
Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func,
func_data);
if (!it) return NULL;
/* It make no sense to insert after in an empty list with after != NULL, something really bad is happening in your app. */
EINA_SAFETY_ON_NULL_RETURN_VAL(wd->items, NULL);
wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it),
EINA_INLIST_GET(after));
if (it->parent)