Skip to content

Commit aafd489

Browse files
committed
Fix bug where unsetting a text value triggered an exception because
None has no replace operation.
1 parent ea62b49 commit aafd489

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

roundup/hyperdb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,8 +1562,10 @@ def fixNewlines(text):
15621562
other systems (eg. email) don't necessarily handle those line
15631563
endings. Our solution is to convert all line endings to LF.
15641564
"""
1565-
text = text.replace('\r\n', '\n')
1566-
return text.replace('\r', '\n')
1565+
if text is not None:
1566+
text = text.replace('\r\n', '\n')
1567+
return text.replace('\r', '\n')
1568+
return text
15671569

15681570
def rawToHyperdb(db, klass, itemid, propname, value, **kw):
15691571
""" Convert the raw (user-input) value to a hyperdb-storable value. The

0 commit comments

Comments
 (0)