-
-
Notifications
You must be signed in to change notification settings - Fork 250
Closed
Description
I was testing out the get_token_balance.py example. I found that there is a case where the response is empty but the status code is 200; An exception is thrown:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The issue is in client.py:
if req.status_code == 200:
return json.loads(req.text)
In this case req.text
is empty so executing json.loads() on an empty string throws the aforementioned exception.
There should be a check for an empty response. I have implemented a fix but I wanted to check with you before initiating a pull request.
P.S. This is a fantastic project that I would love contributing to!
Metadata
Metadata
Assignees
Labels
No labels