From 0ac7e5ee952279f5f58693b92dd6479143c47a79 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 1 Jan 2020 15:23:26 +0100 Subject: [PATCH] fixing json error --- rowers/c2stuff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index 5d184895..87895291 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -821,7 +821,10 @@ def get_userid(access_token): return 0 - me_json = response.json() + try: + me_json = response.json() + except JSONDecodeError: + return 0 try: res = me_json['data']['id'] except KeyError: