efl_ui_widget: fix dereference null return value issues

Dereference null return value issues is reported by Coverity.

If `sd` is NULL, it will return zero values.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9668
This commit is contained in:
Yeongjong Lee 2019-08-21 07:43:55 +00:00 committed by Marcel Hollerbach
parent 38cec03d67
commit 5f4c9a4458
1 changed files with 2 additions and 0 deletions

View File

@ -5615,6 +5615,7 @@ static Efl_Canvas_Layout_Part_Type
_efl_ui_widget_part_efl_canvas_layout_part_type_get(const Eo *obj EINA_UNUSED, Elm_Part_Data *pd)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(pd->obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EFL_CANVAS_LAYOUT_PART_TYPE_NONE);
return efl_canvas_layout_part_type_get(efl_part(sd->resize_obj, pd->part));
}
@ -5622,6 +5623,7 @@ static Eina_Rect
_efl_ui_widget_part_efl_gfx_entity_geometry_get(const Eo *obj EINA_UNUSED, Elm_Part_Data *pd)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(pd->obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_RECT_EMPTY());
return efl_gfx_entity_geometry_get(efl_part(sd->resize_obj, pd->part));
}