From 74d45363221663888840478e45224f0fd68381eb Mon Sep 17 00:00:00 2001 From: Hazem Krimi Date: Thu, 16 Apr 2026 17:31:46 +0100 Subject: [PATCH] fix: handle non existing vm file passed as argument --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 3a93909..2348a12 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,6 +13,11 @@ int process(std::string inputPath, std::string outputPath, std::ios_base::openmode outputStreamMode, bool &init) { + if (!std::filesystem::exists(inputPath)) { + std::cerr << "File does not exist!" << std::endl; + exit(1); + } + std::ifstream ifs(inputPath); std::ofstream ofs(outputPath, outputStreamMode); std::string fileName = getFileNameFromFilePath(inputPath);