more fault-tolerance: avoid errors when title or description is None
This commit is contained in:
parent
1738590455
commit
2b29428e32
1 changed files with 4 additions and 0 deletions
|
@ -429,6 +429,8 @@ class IndexAttributes(object):
|
||||||
if self.adaptedIndexAttributes is not None:
|
if self.adaptedIndexAttributes is not None:
|
||||||
return self.adaptedIndexAttributes.text()
|
return self.adaptedIndexAttributes.text()
|
||||||
description = self.context.description
|
description = self.context.description
|
||||||
|
if description is None:
|
||||||
|
description = u''
|
||||||
if isinstance(description, I18NValue):
|
if isinstance(description, I18NValue):
|
||||||
description = ' '.join(description.values())
|
description = ' '.join(description.values())
|
||||||
actx = self.adapted
|
actx = self.adapted
|
||||||
|
@ -441,6 +443,8 @@ class IndexAttributes(object):
|
||||||
def title(self):
|
def title(self):
|
||||||
context = self.context
|
context = self.context
|
||||||
title = context.title
|
title = context.title
|
||||||
|
if title is None:
|
||||||
|
title = u''
|
||||||
if isinstance(title, I18NValue):
|
if isinstance(title, I18NValue):
|
||||||
title = ' '.join(title.values())
|
title = ' '.join(title.values())
|
||||||
return ' '.join((getName(context), title)).strip()
|
return ' '.join((getName(context), title)).strip()
|
||||||
|
|
Loading…
Add table
Reference in a new issue