elementary/pager - some code optimization & add exception handling for null content.
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 4 Jun 2011 08:41:26 +0000 (08:41 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 4 Jun 2011 08:41:26 +0000 (08:41 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@59956 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_pager.c

index a5e8170..4251bfb 100644 (file)
@@ -333,12 +333,13 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
-   Item *it = ELM_NEW(Item);
    Evas_Coord x, y, w, h;
-   if (!wd) return;
+   Item *it;
 
+   if ((!wd) || (!content)) return;
    if (_item_get(obj, content)) return;
 
+   it = ELM_NEW(Item);
    if (!it) return;
    it->obj = obj;
    it->content = content;