From 9cacc58cb5ea366b77ba58a4fe125bbc5dfe38a1 Mon Sep 17 00:00:00 2001 From: klimoza Date: Fri, 22 Jul 2022 09:51:24 +0300 Subject: [PATCH] Minor fixes --- listener.py | 2 ++ 1 file changed, 2 insertions(+) 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"]