changeset 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 173fd7b9198f
children adf7f617bda9 a2552f1e450e
files backend/couchdb/CouchDbBackend.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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):