Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for empty output
Browse files Browse the repository at this point in the history
eaasna committed Oct 7, 2024
1 parent 29295c1 commit fbd6199
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/consolidate/merge_processes.cpp
Original file line number Diff line number Diff line change
@@ -41,14 +41,16 @@ bool merge_processes(search_arguments const & arguments,
if (error_in_delete)
std::cerr << "Could not clean up intermediate file: \t" << std::string(path) << '\n';
}
std::filesystem::path stellar_out_dir = std::filesystem::path(exec_meta.output_files[0]).parent_path();
if (std::filesystem::is_empty(stellar_out_dir))
if (exec_meta.output_files.size() > 0)
{
const bool error_in_delete = !std::filesystem::remove(stellar_out_dir);
if (error_in_delete)
std::cerr << "Could not delete folder: " << std::string(stellar_out_dir) << '\n';
std::filesystem::path stellar_out_dir = std::filesystem::path(exec_meta.output_files[0]).parent_path();
if (std::filesystem::is_empty(stellar_out_dir))
{
const bool error_in_delete = !std::filesystem::remove(stellar_out_dir);
if (error_in_delete)
std::cerr << "Could not delete folder: " << std::string(stellar_out_dir) << '\n';
}
}

return check_external_process_success(merge_process_args, merge);
}

0 comments on commit fbd6199

Please sign in to comment.