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:
parent
e108c98826
commit
10e86c759c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue