Fix None input string

Fix for files without title string
This commit is contained in:
Luca Fanciullini 2024-11-10 15:02:47 +01:00 committed by GitHub
parent 068ec7a863
commit d3e201aba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,6 +92,9 @@ def remove_special_characters(input_string):
Returns:
str: A new string with specified special characters removed.
"""
# Replace the None input string with an empty string to avoid later exceptions, works best if moved to the begin of the process
if input_string is None:
return ''
# Compile regular expression pattern to match special characters
pattern = re.compile('[' + re.escape(special_chars_to_remove) + ']')