From fda013920dd0ed03cbe47f1381e9b13e6b6d064b Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 13 Jun 2011 07:43:11 +0000 Subject: [PATCH] elementary: add safety check to prevent some ill request. SVN revision: 60261 --- legacy/elementary/src/lib/elm_genlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index cf606cbc77..800064fc6a 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -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)