diff --git a/src/consolidate/merge_processes.cpp b/src/consolidate/merge_processes.cpp index d05927f2..99328758 100644 --- a/src/consolidate/merge_processes.cpp +++ b/src/consolidate/merge_processes.cpp @@ -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); }