summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2020-02-12 09:05:42 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-02-12 09:07:48 -0500
commitb7db2edeeca402a4999b3d3a3807ec7f2ce8bc0d (patch)
treea8de73e6ce6674e6307b406e6af12830cae9fb7c
parent2170a993882f28637a6b628a414863f4c00ea846 (diff)
elc_fileselector: add NULL check for eina_value_type_get
Reviewers: Jaehyun_Cho, Hermet, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11314
-rw-r--r--src/lib/elementary/elc_fileselector.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c
index 39f1a7c..eb107b1 100644
--- a/src/lib/elementary/elc_fileselector.c
+++ b/src/lib/elementary/elc_fileselector.c
@@ -2406,6 +2406,11 @@ _properties_ready(void *data, const Efl_Event *ev)
2406 Eina_Bool is_dir = EINA_FALSE; 2406 Eina_Bool is_dir = EINA_FALSE;
2407 2407
2408 value = efl_model_property_get(ev->object, "is_dir"); 2408 value = efl_model_property_get(ev->object, "is_dir");
2409 if (!eina_value_type_get(value))
2410 {
2411 ERR("Empty type for 'is_dir'");
2412 return;
2413 }
2409 if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL) 2414 if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL)
2410 { 2415 {
2411 ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value)); 2416 ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value));
@@ -2471,6 +2476,11 @@ _elm_fileselector_selected_set_internal(Evas_Object *obj, const char *path)
2471 2476
2472 efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj); 2477 efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
2473 value = efl_model_property_get(pd->target, "is_dir"); 2478 value = efl_model_property_get(pd->target, "is_dir");
2479 if (!eina_value_type_get(value))
2480 {
2481 ERR("Empty type for 'is_dir'");
2482 goto clean_up;
2483 }
2474 if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR) 2484 if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR)
2475 { 2485 {
2476 Eina_Error err = 0; 2486 Eina_Error err = 0;
@@ -2507,6 +2517,11 @@ _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fil
2507 2517
2508 efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj); 2518 efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj);
2509 value = efl_model_property_get(pd->target, "is_dir"); 2519 value = efl_model_property_get(pd->target, "is_dir");
2520 if (!eina_value_type_get(value))
2521 {
2522 ERR("Empty type for 'is_dir'");
2523 goto clean_up;
2524 }
2510 if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR) 2525 if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR)
2511 { 2526 {
2512 Eina_Error err = 0; 2527 Eina_Error err = 0;