Skip to content

Commit ba0daea

Browse files
committed
Avoid converting None to string
1 parent c6fcbec commit ba0daea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

process_request/routines.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Processor(object):
2020

2121
def strip_tags(self, user_string):
2222
"""Strips XML and HTML tags from a string."""
23+
if user_string is None:
24+
return None
2325
try:
2426
xmldoc = ET.fromstring(f'<xml>{user_string}</xml>')
2527
textcontent = ''.join(xmldoc.itertext())

0 commit comments

Comments
 (0)