Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql	11 Jul 2011 09:38:09 -0000	1.1
+++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.8.0d1-5.8.0d2.sql	6 Aug 2012 18:06:14 -0000	1.2
@@ -644,7 +644,8 @@
           from cr_items i, cr_revisions r
          where i.item_id = r.item_id
            and r.revision_id = old.revision_id
-           and i.storage_type = 'file';
+           and i.storage_type = 'file'
+           and r.content is not null;
 
         return old;
 END;
