RSS: Fix feeds with missing description or title

An AttributeError would be raised when a blacklist or a whitelist
would be set on feeds that miss either a title or a description.
This commit is contained in:
Tasos Sahanidis 2018-03-14 00:32:17 +02:00 committed by Valentin Lorentz
parent e2180a1e08
commit b900a369a4
1 changed files with 5 additions and 2 deletions

View File

@ -403,12 +403,15 @@ class RSS(callbacks.Plugin):
all = __builtins__['all']
any = __builtins__['any']
title = getattr(entry, 'title', '')
description = getattr(entry, 'description', '')
if whitelist:
if all(kw not in entry.title and kw not in entry.description
if all(kw not in title and kw not in description
for kw in whitelist):
return False
if blacklist:
if any(kw in entry.title or kw in entry.description
if any(kw in title or kw in description
for kw in blacklist):
return False
return True