From d3e201aba7f2f2149ab29c06110d3846179bf31a Mon Sep 17 00:00:00 2001 From: Luca Fanciullini <44113285+Luciferino90@users.noreply.github.com> Date: Sun, 10 Nov 2024 15:02:47 +0100 Subject: [PATCH] Fix None input string Fix for files without title string --- Src/Util/os.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Src/Util/os.py b/Src/Util/os.py index e52baf6..e68af9f 100644 --- a/Src/Util/os.py +++ b/Src/Util/os.py @@ -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) + ']')