From 13446491b210763a49bb4b39e9ca1d8b0fc4bad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Tue, 2 Aug 2011 06:02:27 +0000 Subject: [PATCH] 5120: 'Export view' to odt file crashs (patch by PaulFranklin) svn: r17986 --- src/docgen/ODSTab.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/docgen/ODSTab.py b/src/docgen/ODSTab.py index 057f11faa..bdc4cc697 100644 --- a/src/docgen/ODSTab.py +++ b/src/docgen/ODSTab.py @@ -385,12 +385,13 @@ class ODSTab(TabbedDoc): self.f.write('>\n') self.f.write('') - text = text.replace('&','&') # Must be first - text = text.replace('<','<') - text = text.replace('>','>') - text = text.replace('\t','') - text = text.replace('\n','') - self.f.write(unicode(text)) + if text is not None: # it must not be just 'if text' + text = text.replace('&','&') # Must be first + text = text.replace('<','<') + text = text.replace('>','>') + text = text.replace('\t','') + text = text.replace('\n','') + self.f.write(unicode(text)) self.f.write('\n') self.f.write('\n')