From 5ee78f464640868e7d974852edc25ca9eda26aea Mon Sep 17 00:00:00 2001 From: pbalcer Date: Wed, 9 Aug 2023 10:48:02 +0200 Subject: [PATCH] [loader] fix potential uncaught exception --- source/loader/ur_adapter_registry.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/loader/ur_adapter_registry.hpp b/source/loader/ur_adapter_registry.hpp index 744d988336..e33548ed88 100644 --- a/source/loader/ur_adapter_registry.hpp +++ b/source/loader/ur_adapter_registry.hpp @@ -33,7 +33,14 @@ class AdapterRegistry { if (forceLoadedAdaptersOpt.has_value()) { for (const auto &s : forceLoadedAdaptersOpt.value()) { auto path = fs::path(s); - if (fs::exists(path)) { + bool exists = false; + try { + exists = fs::exists(path); + } catch (std::exception &e) { + logger::error(e.what()); + } + + if (exists) { adaptersLoadPaths.emplace_back(std::vector{path}); } else { logger::warning(