Avoid running into exception when checking whether executable exists

When we cannot even check whether the executable exists we can just assume
it doesn't.
This commit is contained in:
Martchus 2023-11-08 17:26:04 +01:00
parent e108c98826
commit 10e86c759c
1 changed files with 2 additions and 1 deletions

View File

@ -163,7 +163,8 @@ inline boost::filesystem::path findExecutable(const std::string &nameOrPath)
inline bool checkExecutable(const boost::filesystem::path &path)
{
return !path.empty() && boost::filesystem::exists(path);
auto ec = boost::system::error_code();
return !path.empty() && boost::filesystem::exists(path, ec);
}
} // namespace LibRepoMgr