efl_ui_focus_manager: there is the case that n can be NULL
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Wed, 21 Dec 2016 11:28:44 +0000 (12:28 +0100)
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>
Thu, 20 Apr 2017 12:38:58 +0000 (14:38 +0200)
src/lib/elementary/efl_ui_focus_manager.c

index 3ec1c7a..7f650f3 100644 (file)
@@ -1178,10 +1178,13 @@ _efl_ui_focus_manager_move(Eo *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Data *pd, E
              if (direction == EFL_UI_FOCUS_DIRECTION_NEXT ||
                  direction == EFL_UI_FOCUS_DIRECTION_PREV)
                {
-                 n = T(n).parent;
-                 new_candidate = _request_move(obj, pd, direction, n);
-                 efl_ui_focus_manager_focus(obj, new_candidate);
-                 candidate = new_candidate;
+                 if (n)
+                   {
+                      n = T(n).parent;
+                      new_candidate = _request_move(obj, pd, direction, n);
+                      efl_ui_focus_manager_focus(obj, new_candidate);
+                      candidate = new_candidate;
+                   }
                }
              else
                {