[api] fix: crashing when trying to retrieve a file size without proving its URL

This commit is contained in:
Vinicius Moreira
2021-11-17 15:36:21 -03:00
parent b50b067158
commit 46a3b46652
2 changed files with 5 additions and 0 deletions

View File

@@ -69,6 +69,9 @@ class HttpClient:
return yaml.safe_load(res.text) if res else None
def get_content_length_in_bytes(self, url: str, session: bool = True) -> Optional[int]:
if not url:
return None
params = {'url': url, 'allow_redirects': True, 'stream': True}
try: