Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _codeql_detected_source_root
19 changes: 16 additions & 3 deletions core/src/gnss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ std::vector<std::string> GNSS::get_available_geoids()
for (const auto& path : PathCandidate)
{
std::filesystem::path proj_path(path);
if (std::filesystem::exists(proj_path))
std::error_code ec;
if (std::filesystem::exists(proj_path, ec) && !ec)
{
for (const auto& entry : std::filesystem::directory_iterator(proj_path))
std::filesystem::directory_iterator dir_it(proj_path, ec);
if (ec)
{
if (entry.is_regular_file() && entry.path().extension() == ".gtx")
std::cerr << "cannot open directory " << proj_path << ": " << ec.message() << std::endl;
continue;
}
for (; dir_it != std::filesystem::directory_iterator(); dir_it.increment(ec))
{
if (ec)
{
std::cerr << "error iterating directory " << proj_path << ": " << ec.message() << std::endl;
break;
}
const auto& entry = *dir_it;
if (entry.is_regular_file(ec) && !ec && entry.path().extension() == ".gtx")
{
std::cout << "found geoid model: " << entry.path().filename().string() << std::endl;
unique.insert(entry.path().filename().string());
Expand Down