swallow: check if swallow_regex doesn't exist (#8265)

Avoid to run CWindow::getSwallower() when `swallow_regex` doesn't exist in the user's config file.
This commit is contained in:
Aqa-Ib 2024-10-28 16:52:14 +00:00 committed by GitHub
parent 2c481202ef
commit d49a1334a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1535,7 +1535,7 @@ PHLWINDOW CWindow::getSwallower() {
static auto PSWALLOWEXREGEX = CConfigValue<std::string>("misc:swallow_exception_regex");
static auto PSWALLOW = CConfigValue<Hyprlang::INT>("misc:enable_swallow");
if (!*PSWALLOW || (*PSWALLOWREGEX).empty())
if (!*PSWALLOW || std::string{*PSWALLOWREGEX} == STRVAL_EMPTY || (*PSWALLOWREGEX).empty())
return nullptr;
// check parent