diff --git a/db.py b/db.py index 46cf3aab..ad9b5e46 100644 --- a/db.py +++ b/db.py @@ -568,7 +568,10 @@ class Overwatch(Base): if r.status_code != 200: raise RequestError(f"OWAPI.net returned {r.status_code}") try: - j = r.json()["eu"]["stats"]["competitive"]["overall_stats"] + j = r.json()["eu"]["stats"].get("competitive") + if j is None: + raise RequestError("Something went wrong when retrieving the stats.") + j = j["overall_stats"] except TypeError: raise RequestError("Something went wrong when retrieving the stats.") try: