From a3409d2e8f72c3caf930ebad94ddd41c96f3767b Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 14 Feb 2018 08:56:38 +0100 Subject: [PATCH] AdBlockSubscription: Ignore empty lines in list --- src/lib/adblock/adblocksubscription.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/adblock/adblocksubscription.cpp b/src/lib/adblock/adblocksubscription.cpp index b91157f4c..b1ed6a986 100644 --- a/src/lib/adblock/adblocksubscription.cpp +++ b/src/lib/adblock/adblocksubscription.cpp @@ -1,6 +1,6 @@ /* ============================================================ * Falkon - Qt web browser -* Copyright (C) 2010-2017 David Rosca +* Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -119,12 +119,14 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules) m_rules.clear(); while (!textStream.atEnd()) { - AdBlockRule* rule = new AdBlockRule(textStream.readLine(), this); - + const QString line = textStream.readLine().trimmed(); + if (line.isEmpty()) { + continue; + } + AdBlockRule *rule = new AdBlockRule(line, this); if (disabledRules.contains(rule->filter())) { rule->setEnabled(false); } - m_rules.append(rule); }