Mercurial > hg > Feedworm
diff backend/couchdb/CouchDbBackend.py @ 204:4cb22b47b659
Due to a bug in CouchDB it's possible that a view still references deleted documents. Detect this case and don't add NoneType objects into the list of feeds.
author | dirk |
---|---|
date | Tue, 03 Apr 2012 05:35:13 +0200 |
parents | 50b578588405 |
children | 1ac0b8e2feae 524cbf9e413c |
line wrap: on
line diff
--- a/backend/couchdb/CouchDbBackend.py Tue Apr 03 04:54:06 2012 +0200 +++ b/backend/couchdb/CouchDbBackend.py Tue Apr 03 05:35:13 2012 +0200 @@ -48,7 +48,10 @@ feedsWithUnreadEntries = [] for row in viewResults: feed = Feed.load(self.database, row["key"]) - feedsWithUnreadEntries.append(feed) + # see https://issues.apache.org/jira/browse/COUCHDB-1279 + # it's possible that the view references documents that have already been deleted + if feed is not None: + feedsWithUnreadEntries.append(feed) return feedsWithUnreadEntries def _retrieveEntriesForSelectedFeed(self, hideReadEntries):