Skip to content

Commit 8e5b2f7

Browse files
committed
check if structure is read using json.loads()
1 parent 7e0754d commit 8e5b2f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mergin/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ def _do_request(self, request):
240240
or e.headers.get("Content-Type", "") == "application/json"
241241
):
242242
json_response = json.loads(server_response)
243-
err_detail = json_response.get("detail", None) # `detail` should be present in MM server response
243+
if isinstance(json_response, dict):
244+
err_detail = json_response.get(
245+
"detail", None
246+
) # `detail` should be present in MM server response
244247
if err_detail is None:
245248
err_detail = server_response
246249
else:

0 commit comments

Comments
 (0)