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 Mike Blumenkrantz
parent 419d5e20a4
commit 86c920608a
1 changed files with 2 additions and 0 deletions

View File

@ -5897,6 +5897,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));
}
@ -5904,6 +5905,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));
}