aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-11-24 02:46:24 +0000
committerVaxry <[email protected]>2024-11-24 02:46:28 +0000
commit55ec8bd512605a014cc322d3419a9cfa72178340 (patch)
tree416e3f15c0b5d192b70b033c2f3efcfc7dbaf526
parent54f57797e9d025db72777ccf4adb0ddb25125016 (diff)
downloadHyprland-55ec8bd512605a014cc322d3419a9cfa72178340.tar.gz
Hyprland-55ec8bd512605a014cc322d3419a9cfa72178340.zip
config: throw an error explicitly when parsing colors in gradients
ref #8552
-rw-r--r--src/config/ConfigManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 3429db24..ba0fdd9d 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -67,7 +67,10 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
}
try {
- DATA->m_vColors.push_back(CColor(*configStringToInt(var)));
+ const auto COL = configStringToInt(var);
+ if (!COL)
+ throw std::runtime_error(std::format("failed to parse {} as a color", var));
+ DATA->m_vColors.push_back(CColor(COL.value()));
} catch (std::exception& e) {
Debug::log(WARN, "Error parsing gradient {}", V);
parseError = "Error parsing gradient " + V + ": " + e.what();