]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
web: survive bogus URIs when displaying sizes
authorBrian Warner <warner@lothar.com>
Sun, 8 Jul 2007 04:31:18 +0000 (21:31 -0700)
committerBrian Warner <warner@lothar.com>
Sun, 8 Jul 2007 04:31:18 +0000 (21:31 -0700)
src/allmydata/webish.py

index 4f675f543d14a16988ccfc32a357154635e1fc34..2951787baf609458d8450415a4724964aa7cb261 100644 (file)
@@ -124,7 +124,11 @@ class Directory(rend.Page):
             #ctx.fillSlots("uri", T.a(href=dl_uri_url)[html.escape(uri)])
 
             #extract and display file size
-            ctx.fillSlots("size", unpack_uri(target.get_uri())['size'])
+            try:
+                size = unpack_uri(target.get_uri())['size']
+            except AssertionError:
+                size = "?"
+            ctx.fillSlots("size", size)
 
         elif IDirectoryNode.providedBy(target):
             # directory