gengrid: fix the crash in _elm_gengrid_item_edge_check
authorAmitesh Singh <amitesh.sh@samsung.com>
Sun, 26 Mar 2017 15:14:09 +0000 (20:44 +0530)
committerAmitesh Singh <amitesh.sh@samsung.com>
Sun, 26 Mar 2017 15:18:02 +0000 (20:48 +0530)
_elm_gengrid_item_edge_check can have eo_it as NULL if none of widget item
is focused. This could happen if item_focus is not enabled on items.

test case: elm test -> gengrid 2 (enable only "focus hightligt set") and move focus.

@fix

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
src/lib/elementary/elm_gengrid.c

index 3acfa4d..9a2c61d 100644 (file)
@@ -2699,6 +2699,7 @@ static Eina_Bool
 _elm_gengrid_item_edge_check(Elm_Object_Item *eo_it,
                              Elm_Focus_Direction dir)
 {
+   if (!eo_it) return EINA_FALSE;
    ELM_GENGRID_ITEM_DATA_GET(eo_it, it);
    ELM_GENGRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
    ELM_GENGRID_DATA_GET(WIDGET(it), sd);