Skip to content

Commit

Permalink
#810 fix crash in NSA if the zip archive does not exist yet
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitri Baron <[email protected]>
  • Loading branch information
barondim committed Jan 24, 2025
1 parent 830d8ab commit 525cc43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sources/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void dumpZipArchive(std::unordered_map<std::string, std::string> &mapOutputFiles

boost::shared_ptr<zip::ZipFile> archive = zip::ZipFileFactory::newInstance();
const std::string archivePath = createAbsolutePath("outputs.zip", outputPath.generic_string());
if (!runtimeConfig.contingenciesFilePath.empty())
if (!runtimeConfig.contingenciesFilePath.empty() && boost::filesystem::exists(archivePath))
archive = zip::ZipInputStream::read(archivePath);
for (const std::pair<std::string, std::string> &outputFile : mapOutputFilesData) {
archive->addEntry(outputFile.first, outputFile.second);
Expand Down

0 comments on commit 525cc43

Please sign in to comment.