only close inner file handle if it was initilized

This commit is contained in:
Anthony Minessale 2011-08-17 18:10:44 -05:00
parent f2b66d3d85
commit 30d7ad878c
1 changed files with 3 additions and 1 deletions

View File

@ -3669,7 +3669,9 @@ static switch_status_t file_string_file_close(switch_file_handle_t *handle)
{
file_string_context_t *context = handle->private_info;
switch_core_file_close(&context->fh);
if (switch_test_flag((&context->fh), SWITCH_FILE_OPEN)) {
switch_core_file_close(&context->fh);
}
return SWITCH_STATUS_SUCCESS;
}