From c07e01c0101397b6982db9ed70fcd8d9f08756d2 Mon Sep 17 00:00:00 2001 From: ikalco <73481042+ikalco@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:37:34 -0500 Subject: [PATCH] handle file errors when loading xcursor themes --- src/managers/XCursorManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/managers/XCursorManager.cpp b/src/managers/XCursorManager.cpp index 3d36add585a..0921bcd409a 100644 --- a/src/managers/XCursorManager.cpp +++ b/src/managers/XCursorManager.cpp @@ -511,8 +511,11 @@ std::vector> CXCursorManager::loadAllFromDir(std::string const& pa if (std::filesystem::exists(path) && std::filesystem::is_directory(path)) { for (const auto& entry : std::filesystem::directory_iterator(path)) { - if (!entry.is_regular_file() && !entry.is_symlink()) + std::error_code e1, e2; + if ((!entry.is_regular_file(e1) && !entry.is_symlink(e2)) || e1 || e2) { + Debug::log(WARN, "XCursor failed to load shape {}: {}", entry.path().stem().string(), e1 ? e1.message() : e2.message()); continue; + } auto const& full = entry.path().string(); using PcloseType = int (*)(FILE*);