Check object type before task run

This commit is contained in:
fvanroie 2021-05-16 21:59:09 +02:00
parent 5f6e0cf45e
commit 00962f1538

View File

@ -75,7 +75,7 @@ void event_timer_calendar(lv_task_t* task)
lv_obj_t* obj = NULL; lv_obj_t* obj = NULL;
if(data) obj = hasp_find_obj_from_page_id(data->pageid, data->objid); if(data) obj = hasp_find_obj_from_page_id(data->pageid, data->objid);
if(!obj || !data) { if(!obj || !data || !obj_check_type(obj, LV_HASP_CALENDER)) {
if(data) lv_mem_free(data); // the object that the user_data points to is gone if(data) lv_mem_free(data); // the object that the user_data points to is gone
lv_task_del(task); // the calendar object for this task was deleted lv_task_del(task); // the calendar object for this task was deleted
LOG_WARNING(TAG_EVENT, "event_timer_calendar could not find the linked object"); LOG_WARNING(TAG_EVENT, "event_timer_calendar could not find the linked object");