bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a20cacf53f4c85d10048c86c96ae92db0de6fff1

commit a20cacf53f4c85d10048c86c96ae92db0de6fff1
Author: YeongJong Lee <[email protected]>
Date:   Wed Jan 31 14:29:12 2018 +0100

    elm_menu: avoid a call to NULL
    
    Summary: the provider_find can be called before parent_set in constructor.
    
    Test Plan:
    1. EINA_LOG_LEVELS=eo:2 elementary_test -to menu
    2. check that there is no warning message about efl_provider_find
    
    Reviewers: jpeg, bu5hm4n
    
    Reviewed By: bu5hm4n
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D5773
---
 src/lib/elementary/elm_menu.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c
index 0e2bd3b1e6..00d1b50e1a 100644
--- a/src/lib/elementary/elm_menu.c
+++ b/src/lib/elementary/elm_menu.c
@@ -1509,13 +1509,10 @@ _elm_menu_efl_access_selection_selected_child_get(Eo 
*obj EINA_UNUSED, Elm_Menu_
 EOLIAN static Efl_Object*
 _elm_menu_efl_object_provider_find(const Eo *obj, Elm_Menu_Data *pd, const 
Efl_Object *klass)
 {
-   Efl_Object *result;
+   if (!pd->parent)
+     return efl_provider_find(efl_super(obj, MY_CLASS), klass);
 
-   result = efl_provider_find(pd->parent, klass);
-
-   if (result) return result;
-
-   return efl_provider_find(efl_super(obj, MY_CLASS), klass);
+   return efl_provider_find(pd->parent, klass);
 }
 
 

-- 


Reply via email to