From e89aa5e2cf07c7f74c48bf470e4cb37b3642208c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 28 Aug 2018 17:45:07 +0200 Subject: [PATCH] tracer bugfix --- db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: