Skip to content

Commit

Permalink
Avoid converting None to string
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgraham committed Aug 14, 2024
1 parent c6fcbec commit ba0daea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions process_request/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class Processor(object):

def strip_tags(self, user_string):
"""Strips XML and HTML tags from a string."""
if user_string is None:
return None
try:
xmldoc = ET.fromstring(f'<xml>{user_string}</xml>')
textcontent = ''.join(xmldoc.itertext())
Expand Down

0 comments on commit ba0daea

Please sign in to comment.