web/status.py: guard against file_size=None, closes #354
authorBrian Warner <warner@lothar.com>
Mon, 17 Mar 2008 20:31:10 +0000 (13:31 -0700)
committerBrian Warner <warner@lothar.com>
Mon, 17 Mar 2008 20:31:10 +0000 (13:31 -0700)
src/allmydata/web/status.py

index 339c1537756353acb50a8642ef8359209c656856..8203e5b156ac9e88550c576f3d2275315020f56d 100644 (file)
@@ -465,7 +465,7 @@ class RetrieveStatusPage(rend.Page, RateAndTimeMixin):
     def _get_rate(self, data, name):
         file_size = self.retrieve_status.get_size()
         time = self.retrieve_status.timings.get(name)
-        if time is None:
+        if time is None or file_size is None:
             return None
         try:
             return 1.0 * file_size / time