From 6a7c89ec78a2c40c602ef300b061041fd82a84f8 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 30 Nov 2011 13:05:59 +0100 Subject: [PATCH] Do not raise an error if the comment text is None. --- CHANGES.txt | 3 ++- plone/app/discussion/comment.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6c13e4c..aa5f544 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,7 +4,8 @@ Changelog 2.1.2 (unreleased) ------------------ -- nothing. +- Do not raise an error if the comment text is None. + [timo] 2.1.1 (2011-11-24) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 0273b6f..616d79d 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -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,