diff --git a/listener.py b/listener.py index 08ab81c..5bb1d75 100755 --- a/listener.py +++ b/listener.py @@ -189,6 +189,8 @@ def get_collection(contract, net): r = requests.post("https://rpc.testnet.near.org", json=pload) else: r = requests.post("https://rpc.mainnet.near.org", json=pload) + if "result" not in r.json() or "result" not in r.json()["result"]: + return contract result = json.loads(bytearray(r.json()["result"]["result"]).decode("utf-8")) return result["name"]