efl_ui_spotlight: add null check for manager stack data

Like other functions, null check for manager stack data is added before
referencing manager stack data.
This commit is contained in:
Jaehyun Cho 2019-08-23 12:46:10 +09:00
parent a3b3f8d95a
commit d4d1826b47
1 changed files with 3 additions and 1 deletions

View File

@ -62,9 +62,11 @@ static void
_running_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Efl_Ui_Spotlight_Manager_Stack_Data *pd = efl_data_scope_safe_get(data, MY_CLASS);
double absolut_position;
EINA_SAFETY_ON_NULL_RETURN(pd);
//calculate absolut position, multiply pos with 2.0 because duration is only 0.5)
double absolut_position = pd->from + (pd->to - pd->from)*(efl_player_pos_get(pd->show)*2.0);
absolut_position = pd->from + (pd->to - pd->from)*(efl_player_pos_get(pd->show)*2.0);
efl_event_callback_call(data, EFL_UI_SPOTLIGHT_MANAGER_EVENT_POS_UPDATE, &absolut_position);
}