diff --git a/app/utils.py b/app/utils.py index 328d382b..51a50137 100644 --- a/app/utils.py +++ b/app/utils.py @@ -492,7 +492,10 @@ def shorten_string(input_str, max_length=50): def shorten_url(input: str, max_length=20): - return shorten_string(input.replace('https://', '').replace('http://', '')) + if input: + return shorten_string(input.replace('https://', '').replace('http://', '')) + else: + '' # the number of digits in a number. e.g. 1000 would be 4