Commit 0e0367be authored by Romain Courteaud's avatar Romain Courteaud

Do not fail if data property does not exist.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14608 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 74c883ec
...@@ -146,7 +146,8 @@ class Image(File, OFSImage): ...@@ -146,7 +146,8 @@ class Image(File, OFSImage):
self.data = self._data self.data = self._data
# Make sure size is defined # Make sure size is defined
if not hasattr(aq_base(self), 'size') or not self.size: if (not hasattr(aq_base(self), 'size') or not self.size) and \
hasattr(aq_base(self), 'data'):
self.size = len(self.data) self.size = len(self.data)
security.declareProtected(Permissions.AccessContentsInformation, 'getWidth') security.declareProtected(Permissions.AccessContentsInformation, 'getWidth')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment