From 37d1548228be337ebb8e507db48077dfc64b2c25 Mon Sep 17 00:00:00 2001 From: Andreas Volz Date: Sun, 4 Jul 2010 21:50:54 +0000 Subject: [PATCH] some checks to not crash SVN revision: 50036 --- elementaryxx/src/GenList.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/elementaryxx/src/GenList.cpp b/elementaryxx/src/GenList.cpp index 066f6f2..991862f 100644 --- a/elementaryxx/src/GenList.cpp +++ b/elementaryxx/src/GenList.cpp @@ -204,6 +204,9 @@ GenListItem *GenList::getItemSelected () const { Elm_Genlist_Item *item = elm_genlist_selected_item_get (o); + if (!item) + return NULL; + const GenListColumnConstructor *construction = static_cast (elm_genlist_item_data_get (item)); return construction->mGenListItem; @@ -225,6 +228,9 @@ GenListItem *GenList::getItemFirst () const { Elm_Genlist_Item *item = elm_genlist_first_item_get (o); + if (!item) + return NULL; + const GenListColumnConstructor *construction = static_cast (elm_genlist_item_data_get (item)); return construction->mGenListItem; @@ -234,6 +240,9 @@ GenListItem *GenList::getItemLast () const { Elm_Genlist_Item *item = elm_genlist_last_item_get (o); + if (!item) + return NULL; + const GenListColumnConstructor *construction = static_cast (elm_genlist_item_data_get (item)); return construction->mGenListItem;