config: fix uninitialized values with mode parsing

This commit is contained in:
Vaxry 2024-08-24 15:24:55 +02:00
parent e45e606fbd
commit 82c67e61a9

View file

@ -1218,14 +1218,14 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(PHLWINDOW pWindow, boo
std::optional<eFullscreenMode> internalMode, clientMode; std::optional<eFullscreenMode> internalMode, clientMode;
if (ARGS[0] == "*") if (ARGS[0] == "*")
internalMode = {}; internalMode = std::nullopt;
else if (isNumber(ARGS[0])) else if (isNumber(ARGS[0]))
internalMode = (eFullscreenMode)std::stoi(ARGS[0]); internalMode = (eFullscreenMode)std::stoi(ARGS[0]);
else else
throw std::runtime_error("szFullscreenState internal mode not valid"); throw std::runtime_error("szFullscreenState internal mode not valid");
if (ARGS[1] == "*") if (ARGS[1] == "*")
clientMode = {}; clientMode = std::nullopt;
else if (isNumber(ARGS[1])) else if (isNumber(ARGS[1]))
clientMode = (eFullscreenMode)std::stoi(ARGS[1]); clientMode = (eFullscreenMode)std::stoi(ARGS[1]);
else else