From 26d39d39ea1277ed8ca0698e244bbed217dbded0 Mon Sep 17 00:00:00 2001
From: Malte Franken <exxamalte@users.noreply.github.com>
Date: Fri, 31 Aug 2018 20:54:25 +1000
Subject: [PATCH] avoid error in debug log mode and rss entry without title
 (#16316)

---
 homeassistant/components/feedreader.py | 4 ++--
 tests/components/test_feedreader.py    | 6 +++---
 tests/fixtures/feedreader3.xml         | 5 +++++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/homeassistant/components/feedreader.py b/homeassistant/components/feedreader.py
index 782fd8ac8dd..7882cdc5a15 100644
--- a/homeassistant/components/feedreader.py
+++ b/homeassistant/components/feedreader.py
@@ -143,7 +143,7 @@ class FeedManager:
         else:
             self._has_published_parsed = False
             _LOGGER.debug("No published_parsed info available for entry %s",
-                          entry.title)
+                          entry)
         entry.update({'feed_url': self._url})
         self._hass.bus.fire(self._event_type, entry)
 
@@ -164,7 +164,7 @@ class FeedManager:
                 self._update_and_fire_entry(entry)
                 new_entries = True
             else:
-                _LOGGER.debug("Entry %s already processed", entry.title)
+                _LOGGER.debug("Entry %s already processed", entry)
         if not new_entries:
             self._log_no_entries()
         self._firstrun = False
diff --git a/tests/components/test_feedreader.py b/tests/components/test_feedreader.py
index dd98ebaf189..668f116362c 100644
--- a/tests/components/test_feedreader.py
+++ b/tests/components/test_feedreader.py
@@ -160,11 +160,11 @@ class TestFeedreaderComponent(unittest.TestCase):
         manager, events = self.setup_manager(feed_data, max_entries=5)
         assert len(events) == 5
 
-    def test_feed_without_publication_date(self):
-        """Test simple feed with entry without publication date."""
+    def test_feed_without_publication_date_and_title(self):
+        """Test simple feed with entry without publication date and title."""
         feed_data = load_fixture('feedreader3.xml')
         manager, events = self.setup_manager(feed_data)
-        assert len(events) == 2
+        assert len(events) == 3
 
     def test_feed_invalid_data(self):
         """Test feed with invalid data."""
diff --git a/tests/fixtures/feedreader3.xml b/tests/fixtures/feedreader3.xml
index 7b28e067cfe..d8ccd119306 100644
--- a/tests/fixtures/feedreader3.xml
+++ b/tests/fixtures/feedreader3.xml
@@ -21,6 +21,11 @@
             <link>http://www.example.com/link/2</link>
             <guid isPermaLink="false">GUID 2</guid>
         </item>
+        <item>
+            <description>Description 3</description>
+            <link>http://www.example.com/link/3</link>
+            <guid isPermaLink="false">GUID 3</guid>
+        </item>
 
     </channel>
 </rss>
-- 
GitLab