Explorar o código

Response can be None

Foppe Hemminga %!s(int64=6) %!d(string=hai) anos
pai
achega
fe6f4cd66e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      model.py

+ 3 - 1
model.py

@@ -33,7 +33,9 @@ def _get_json(this_id):
 
 def _load_json(this_id):
     this_response = _get_json(this_id)
-    this_json = json.loads(this_response.text)
+    this_json = {}
+    if this_response and this_response.text:
+        this_json = json.loads(this_response.text)
     return this_json