]> git.0d.be Git - earwig.git/commitdiff
sources: handle feeds without image
authorFrédéric Péters <fpeters@0d.be>
Thu, 28 Feb 2019 21:11:21 +0000 (22:11 +0100)
committerFrédéric Péters <fpeters@0d.be>
Thu, 28 Feb 2019 21:11:21 +0000 (22:11 +0100)
earwig/sounds/sources.py

index 3eb6b42739a5dae6b1b23df46cdef05f57600083..48a3ebc4b6ef9a7e583b6f047bfff413c7cc1278 100644 (file)
@@ -31,7 +31,7 @@ class Rss(object):
         feed = feedparser.parse(self.channel.feed_url)
         attrs = {
             'subtitle': getattr(feed.feed, 'subtitle', None),
-            'image_url': feed.feed.image.href if feed.feed.image and feed.feed.image.href else None,
+            'image_url': feed.feed.image.href if getattr(feed.feed, 'image') and feed.feed.image.href else None,
             'license_url': getattr(feed.feed, 'license', None),
         }
         modified = False