From 67dfc7916c25441fa86ad228e017361b6bf35775 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 31 Oct 2024 17:05:44 +0200 Subject: [PATCH] hotfix : check if dir exists --- src/emulator.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index 8b33f81198..ae3cb17ddf 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -308,9 +308,13 @@ void Emulator::LoadSystemModules(const std::filesystem::path& file, std::string LOG_INFO(Loader, "No HLE available for {} module", module_name); } } - for (const auto& entry : std::filesystem::directory_iterator(sys_module_path / game_serial)) { - LOG_INFO(Loader, "Loading {} from game serial file {}", entry.path().string(), game_serial); - linker->LoadModule(entry.path()); + if (std::filesystem::exists(sys_module_path / game_serial)) { + for (const auto& entry : + std::filesystem::directory_iterator(sys_module_path / game_serial)) { + LOG_INFO(Loader, "Loading {} from game serial file {}", entry.path().string(), + game_serial); + linker->LoadModule(entry.path()); + } } }