elm gengrid - fix CID 1222464
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 8 Aug 2014 07:23:10 +0000 (16:23 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 8 Aug 2014 07:23:10 +0000 (16:23 +0900)
it's possible to have a NULL item in this code - also missing a valid
return at the end (though code path never gets there).

src/lib/elm_gengrid.c

index cb5666acb40a322b5211580f05b475fec891be84..120adb8a1da74e090f8647c5d06b36079ff59b76 100644 (file)
@@ -2505,7 +2505,7 @@ _item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir)
         else
           return EINA_FALSE;
      }
-   
+   if (!item) return EINA_FALSE;
    if (sd->reorder_mode && !(sd->focused_item == item))
      {
         _swap_items((Elm_Gen_Item *)sd->focused_item, (Elm_Gen_Item *)item, ELM_FOCUS_RIGHT);
@@ -2516,6 +2516,7 @@ _item_horizontal_loop(Evas_Object *obj, Elm_Focus_Direction dir)
         elm_gengrid_item_selected_set(item, EINA_TRUE);
         return EINA_TRUE;
      }
+   return EINA_FALSE;
 }
 
 static Eina_Bool