diff --git a/src/server/BreCal/validators/validation_base_utils.py b/src/server/BreCal/validators/validation_base_utils.py index 1e44d17..f00bf10 100644 --- a/src/server/BreCal/validators/validation_base_utils.py +++ b/src/server/BreCal/validators/validation_base_utils.py @@ -1,7 +1,8 @@ +import typing from string import ascii_letters, digits -def check_if_string_has_special_characters(text:str): +def check_if_string_has_special_characters(text:typing.Optional[str]): """ check, whether there are any characters within the provided string, which are not found in the ascii letters or digits ascii_letters: abcd (...) and ABCD (...) @@ -11,6 +12,8 @@ def check_if_string_has_special_characters(text:str): User: https://stackoverflow.com/users/10035985/andrej-kesely returns bool """ + if text is None: + return False return bool(set(text).difference(ascii_letters + digits + ' '))