From ac70e21c93f05e1e24e5ddc10ace2a0b4e1a76ae Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 30 Aug 2021 13:59:36 +0200 Subject: [PATCH] More boost::filesystem failure checks --- indra/llfilesystem/lldiskcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp index 37041154d6..589213733a 100644 --- a/indra/llfilesystem/lldiskcache.cpp +++ b/indra/llfilesystem/lldiskcache.cpp @@ -93,7 +93,7 @@ void LLDiskCache::purge() //for (auto& entry : boost::make_iterator_range(boost::filesystem::directory_iterator(cache_path, ec), {})) for (auto& entry : boost::make_iterator_range(boost::filesystem::recursive_directory_iterator(cache_path, ec), {})) { - if (boost::filesystem::is_regular_file(entry, ec) && !ec.failed()) + if (!ec.failed() && (boost::filesystem::is_regular_file(entry, ec) && !ec.failed())) { if (entry.path().string().find(mCacheFilenamePrefix) != std::string::npos) { @@ -485,7 +485,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string dir) //for (auto& entry : boost::make_iterator_range(boost::filesystem::directory_iterator(dir_path, ec), {})) for (auto& entry : boost::make_iterator_range(boost::filesystem::recursive_directory_iterator(dir_path, ec), {})) { - if (boost::filesystem::is_regular_file(entry, ec) && !ec.failed()) + if (!ec.failed() && (boost::filesystem::is_regular_file(entry, ec) && !ec.failed())) { if (entry.path().string().find(mCacheFilenamePrefix) != std::string::npos) {