[V3 i18n] add a NoneType check on trying to normalize a string (#1632)

Fixes #1631
This commit is contained in:
palmtree5 2018-05-13 15:10:38 -08:00 committed by Tobotimus
parent 8739c04024
commit 28bbe9c646

View File

@ -124,6 +124,9 @@ def _normalize(string, remove_newline=False):
s += ' ' s += ' '
return s return s
if string is None:
return ""
string = string.replace('\\n\\n', '\n\n') string = string.replace('\\n\\n', '\n\n')
string = string.replace('\\n', ' ') string = string.replace('\\n', ' ')
string = string.replace('\\"', '"') string = string.replace('\\"', '"')