diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-11-19 01:16:11 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-11-19 01:16:11 +0000 |
| commit | 67cee430061626ccd73dc6d30eed9db289053608 (patch) | |
| tree | 66f095e44bfbc02deec97c11329c51576fe02d54 /src/debug | |
| parent | 47a1650c4810ad3cb3e9f125cb0addf18aa7395c (diff) | |
internal: minor cleanups for color results
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 4d3c2be4..7c0a9417 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1529,9 +1529,8 @@ std::string dispatchNotify(eHyprCtlOutputFormat format, std::string request) { icon = std::stoi(ICON); } catch (std::exception& e) { return "invalid arg 1"; } - if (icon > ICON_NONE || icon < 0) { + if (icon > ICON_NONE || icon < 0) icon = ICON_NONE; - } const auto TIME = vars[2]; int time = 0; @@ -1539,7 +1538,10 @@ std::string dispatchNotify(eHyprCtlOutputFormat format, std::string request) { time = std::stoi(TIME); } catch (std::exception& e) { return "invalid arg 2"; } - CColor color = configStringToInt(vars[3]).value_or(0); + const auto COLOR_RESULT = configStringToInt(vars[3]); + if (!COLOR_RESULT) + return "invalid arg 3"; + CColor color = *COLOR_RESULT; size_t msgidx = 4; float fontsize = 13.f; |
