Ignore corrupted reading rates json file

This commit is contained in:
Kovid Goyal 2022-03-11 12:25:18 +05:30
parent 15d40ce3c1
commit 0d775490b0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -68,5 +68,8 @@ def load_reading_rates(key):
except OSError:
existing = {}
else:
try:
existing = json.loads(raw)
except Exception:
existing = {}
return existing.get(key)