[pim/kdepim-addons] plugins/webengineurlinterceptor/adblock: Fix initialize adblock

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 974baa5418eed9f778e427f8f7d057ebc55fe755 by Laurent Montel.
Committed on 15/08/2026 at 10:21.
Pushed by mlaurent into branch 'master'.

Fix initialize adblock

M  +6    -2    plugins/webengineurlinterceptor/adblock/adblockmanager.cpp

https://invent.kde.org/pim/kdepim-addons/-/commit/974baa5418eed9f778e427f8f7d057ebc55fe755

diff --git a/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp b/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp
index af9675849..75242c34a 100644
--- a/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp
+++ b/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp
@@ -253,8 +253,12 @@ bool AdblockManager::interceptRequest(QWebEngineUrlRequestInfo &info)
 {
     // Only wait for the adblock initialization if it isn't ready on first use
     if (!mAdblock) {
-        qCDebug(LIBADBLOCKPLUGIN_PLUGIN_LOG) << "Adblock not yet initialized, blindly allowing request";
-        return false;
+        if (!mAdblockInitFuture.valid()) {
+            qCWarning(LIBADBLOCKPLUGIN_PLUGIN_LOG) << "Adblock initialization failed, blindly allowing request";
+            return false;
+        }
+        qCDebug(LIBADBLOCKPLUGIN_PLUGIN_LOG) << "Adblock not initialized yet, waiting for it";
+        mAdblock = mAdblockInitFuture.get();
     }
 
     const std::string url = info.requestUrl().toString().toStdString();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.