Do not raise an error if the comment text is None.

This commit is contained in:
Timo Stollenwerk
2011-11-30 13:05:59 +01:00
parent ead76ee406
commit 6a7c89ec78
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -138,6 +138,8 @@ class Comment(CatalogAware, WorkflowAware, DynamicType, Traversable,
settings = registry.forInterface(IDiscussionSettings, check=False)
sourceMimetype = settings.text_transform
text = self.text
if text is None:
return ''
if isinstance(text, unicode):
text = text.encode('utf8')
return transforms.convertTo(targetMimetype,