Add error handling for checking latest version (#360)

This commit is contained in:
Sascha Ißbrücker
2022-10-16 13:04:36 +02:00
committed by GitHub
parent 2fd7704816
commit f84e2d2210
2 changed files with 15 additions and 3 deletions

View File

@@ -54,7 +54,8 @@ def get_version_info(ttl_hash=None):
latest_version_url = 'https://api.github.com/repos/sissbruecker/linkding/releases/latest'
response = requests.get(latest_version_url, timeout=5)
json = response.json()
latest_version = json['name'][1:]
if response.status_code == 200 and 'name' in json:
latest_version = json['name'][1:]
except requests.exceptions.RequestException:
pass