[pim/kdepim-addons] plugins/webengineurlinterceptor/adblock: Check download error

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

Check download error

M  +7    -1    plugins/webengineurlinterceptor/adblock/adblockmanager.cpp

https://invent.kde.org/pim/kdepim-addons/-/commit/4b808e0852576105105856d22285e1cf36dc1984

diff --git a/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp b/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp
index 73d1b826b..809fbd378 100644
--- a/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp
+++ b/plugins/webengineurlinterceptor/adblock/adblockmanager.cpp
@@ -168,7 +168,13 @@ void AdblockManager::handleListFetched(QNetworkReply *reply)
         Q_EMIT refreshFinished();
     }
 
-    const auto id = filterListIdFromUrl(reply->url().toString());
+    if (reply->error() != QNetworkReply::NoError) {
+        qCWarning(LIBADBLOCKPLUGIN_PLUGIN_LOG) << "Impossible to fetch list from " << reply->request().url().toString() << " Error: " << reply->errorString();
+        reply->deleteLater();
+        return;
+    }
+
+    const auto id = filterListIdFromUrl(reply->request().url().toString());
 
     QFile file(filterListPath() + id);
     if (!file.open(QIODevice::WriteOnly)) {
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.