web/views/editcontroller.py
branchtls-sprint
changeset 1765 a25c7c73c8f6
parent 1753 ba01605cdd9a
child 1798 cc86fe8efaaa
--- a/web/views/editcontroller.py	Tue May 12 20:31:35 2009 +0200
+++ b/web/views/editcontroller.py	Tue May 12 20:47:42 2009 +0200
@@ -207,7 +207,7 @@
                 # file modified using a text widget
                 encoding = entity.attr_metadata(attr, 'encoding')
                 value = Binary(value.encode(encoding))
-            else:
+            elif value:
                 # value is a  3-uple (filename, mimetype, stream)
                 val = Binary(value[2].read())
                 if not val.getvalue(): # usually an unexistant file