don't shorten invalid urls

This commit is contained in:
rimu 2025-01-19 15:24:30 +13:00
parent 3871691ea4
commit 20a17c9fb7

View file

@ -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