From 44194d96333f4a72397821458afd72023b6e2a8c Mon Sep 17 00:00:00 2001 From: hermet Date: Mon, 26 Dec 2011 08:03:30 +0000 Subject: [PATCH] elementary/naviframe - prevent accessing a null pointer git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66525 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/Elementary.h.in | 8 ++++---- src/lib/elc_naviframe.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index b55c715..f7905a5 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -30053,14 +30053,14 @@ extern "C" { EAPI Eina_Inlist *elm_naviframe_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** - * @brief Set the event enabled when pushing/popping items + * @brief Set the event enabled when pushing/popping items * - * If @c enabled is EINA_TRUE, the contents of the naviframe item will + * If @c enabled is EINA_TRUE, the contents of the naviframe item will * receives events from mouse and keyboard during view changing such as * item push/pop. * * @param obj The naviframe object - * @param enabled Events are received when enabled is @c EINA_TRUE, and + * @param enabled Events are received when enabled is @c EINA_TRUE, and * ignored otherwise. * * @warning Events will be blocked by calling evas_object_freeze_events_set() @@ -30085,7 +30085,7 @@ extern "C" { */ EAPI Eina_Bool elm_naviframe_event_enabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /** + /** * @} */ diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c index 9177321..66f7ca4 100644 --- a/src/lib/elc_naviframe.c +++ b/src/lib/elc_naviframe.c @@ -817,7 +817,6 @@ _title_content_unset(Elm_Naviframe_Item *it, const char *part) return content; } - static void _item_del(Elm_Naviframe_Item *it) { @@ -1362,6 +1361,8 @@ elm_naviframe_item_del(Elm_Object_Item *it) { wd->stack = eina_inlist_remove(wd->stack, EINA_INLIST_GET(navi_it)); _item_del(navi_it); + //If the item is only one, the stack will be empty + if (!wd->stack) return; navi_it = EINA_INLIST_CONTAINER_GET(wd->stack->last, Elm_Naviframe_Item); evas_object_show(VIEW(navi_it)); -- 2.7.4