eio-model: Fixed crash when files are created in the temporary dir

Fixed a crash when temporary files were created before the tested file, causing a dereference of a NULL pointer.
This commit is contained in:
Felipe Magno de Almeida 2015-04-10 17:09:07 -03:00
parent dea4bcf47c
commit 37a04b09d2
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ _load_monitor_status_cb(void *data, Eo *obj, const Eo_Event_Description *desc EI
str = eina_value_to_string(value_prop);
fail_if(!str, "ERROR: Cannot convert value to string!\n");
fprintf(stderr, "new children filename %s\n", str);
if(strcmp(str, temp_filename) == 0)
if(temp_filename && strcmp(str, temp_filename) == 0)
{
fprintf(stderr, "is child that we want\n");
eo_do(obj, eo_event_callback_del(EFL_MODEL_BASE_EVENT_LOAD_STATUS, _load_monitor_status_cb, data));
@ -64,7 +64,7 @@ _children_removed_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Event
str = eina_value_to_string(value_prop);
fail_if(!str, "ERROR: Cannot convert value to string!\n");
if(strcmp(str, temp_filename) == 0)
if(temp_filename && strcmp(str, temp_filename) == 0)
ecore_main_loop_quit();
}
}