SKY-3781 Fix empty URL bug (#1016)

This commit is contained in:
Shuchang Zheng
2024-10-21 07:59:40 -07:00
committed by GitHub
parent 62e5665b22
commit 9a9057ccf7

View File

@@ -8,8 +8,9 @@ from skyvern.exceptions import InvalidUrl
def validate_url(url: str) -> str:
try:
# Use parse_obj_as to validate the string as an HttpUrl
parse_obj_as(HttpUrl, url)
if url:
# Use parse_obj_as to validate the string as an HttpUrl
parse_obj_as(HttpUrl, url)
return url
except ValidationError:
# Handle the validation error