From 4824fbd7273c5c97a153b627b26f2aaa5df34dae Mon Sep 17 00:00:00 2001 From: Aqa-Ib Date: Sun, 27 Oct 2024 17:58:10 +0000 Subject: [PATCH] swallow: check if swallow_regex doesn't exist Avoid to run CWindow::getSwallower() when `swallow_regex` doesn't exist in the user's config file. --- src/desktop/Window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 0772b676406..2537eeb062f 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1531,7 +1531,7 @@ PHLWINDOW CWindow::getSwallower() { static auto PSWALLOWEXREGEX = CConfigValue("misc:swallow_exception_regex"); static auto PSWALLOW = CConfigValue("misc:enable_swallow"); - if (!*PSWALLOW || (*PSWALLOWREGEX).empty()) + if (!*PSWALLOW || std::string{*PSWALLOWREGEX} == STRVAL_EMPTY || (*PSWALLOWREGEX).empty()) return nullptr; // check parent