elementary: add safety check to prevent some ill request.
authorCedric BAIL <cedric.bail@free.fr>
Mon, 13 Jun 2011 07:43:11 +0000 (07:43 +0000)
committerCedric BAIL <cedric.bail@free.fr>
Mon, 13 Jun 2011 07:43:11 +0000 (07:43 +0000)
SVN revision: 60261

legacy/elementary/src/lib/elm_genlist.c

index cf606cb..800064f 100644 (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)