diff --git a/etherscan/client.py b/etherscan/client.py index 613f56a..6bf8872 100644 --- a/etherscan/client.py +++ b/etherscan/client.py @@ -47,7 +47,12 @@ def connect(self): except requests.exceptions.ConnectionError: return "Connection refused" if req.status_code == 200: - return json.loads(req.text) + # Check for empty response + if req.text: + return json.loads(req.text) + else: + print("Invalid Request") + exit() else: print("problem with connection, status code: ", req.status_code) exit()