ecore: efl_model_list_value_get will throw error when asked for out of range value.

This commit is contained in:
Cedric BAIL 2018-04-12 14:39:45 -07:00
parent 67d9c0c11e
commit af9b5f2f85
1 changed files with 4 additions and 1 deletions

View File

@ -40,7 +40,10 @@ efl_model_list_value_get(Eina_List *childrens,
Eina_List *l;
Eo *child;
eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, eina_list_count(childrens));
if (eina_list_count(childrens) < start + count)
return eina_value_error_init(EFL_MODEL_ERROR_INCORRECT_VALUE);
eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, 4);
childrens = eina_list_nth_list(childrens, start);