Commit b7f91e5b authored by Julien Osman's avatar Julien Osman
Browse files

BUG: Prevent segfault when invalid simlink in DEM directory

parent 6a79318a
......@@ -56,6 +56,8 @@ std::vector<std::string> GetFilesInDirectory(const std::string & directoryPath)
// End iterator : default construction yields past-the-end
for ( const auto & item : boost::make_iterator_range(boost::filesystem::directory_iterator(directoryPath), {}) )
{
try
{
if ( boost::filesystem::is_directory(item.status()) )
{
......@@ -67,6 +69,11 @@ std::vector<std::string> GetFilesInDirectory(const std::string & directoryPath)
fileList.push_back(item.path().string());
}
}
catch (boost::filesystem::filesystem_error& e)
{
otbLogMacro(Warning, << e.what())
}
}
return fileList;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment