From d49a1334a8af7c704626cdf1746cb72415ad6d0d Mon Sep 17 00:00:00 2001 From: Aqa-Ib Date: Mon, 28 Oct 2024 16:52:14 +0000 Subject: [PATCH] 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. --- 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 e4f987eb..60f3b79d 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1535,7 +1535,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