forked from enlightenment/efl
elm_slider: add null check to avoid seg fault.
Summary: a segmentation fault occurs once the argument is not valid. Test Plan: N/A Reviewers: eagleeye, devilhorns, zmike Reviewed By: eagleeye, zmike Subscribers: #committers, cedric, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6362
This commit is contained in:
parent
4378d6feb9
commit
ddeae96421
|
@ -1236,7 +1236,7 @@ EAPI void
|
|||
elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
||||
{
|
||||
Efl_Ui_Dir dir;
|
||||
EFL_UI_SLIDER_DATA_GET(obj, sd2);
|
||||
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2);
|
||||
|
||||
dir = _direction_get(horizontal, _is_inverted(sd2->dir));
|
||||
|
||||
|
@ -1246,6 +1246,8 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
|||
EAPI Eina_Bool
|
||||
elm_slider_horizontal_get(const Evas_Object *obj)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
|
||||
|
||||
Efl_Ui_Dir dir;
|
||||
dir = efl_ui_direction_get(obj);
|
||||
|
||||
|
@ -1280,7 +1282,7 @@ EAPI void
|
|||
elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted)
|
||||
{
|
||||
Efl_Ui_Dir dir;
|
||||
EFL_UI_SLIDER_DATA_GET(obj, sd2);
|
||||
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2);
|
||||
|
||||
dir = _direction_get(_is_horizontal(sd2->dir), inverted);
|
||||
|
||||
|
|
Loading…
Reference in New Issue