From b7872bc9cf95adda73e3cd7e90888c65c128e1f1 Mon Sep 17 00:00:00 2001 From: Boris Melnik Date: Thu, 18 Nov 2021 18:43:35 +0300 Subject: [PATCH] fix: check if contract exists before getting address (#105) Closes: #3963 --- status/ens.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/status/ens.nim b/status/ens.nim index dcf98f3..f7a292c 100644 --- a/status/ens.nim +++ b/status/ens.nim @@ -320,7 +320,10 @@ proc setPubKey*(username, pubKey, address, gas, gasPrice: string, isEIP1559Enabl proc statusRegistrarAddress*():string = let network = status_settings.getCurrentNetwork().toNetwork() - result = $contracts.findContract(network.chainId, "ens-usernames").address + let contract = contracts.findContract(network.chainId, "ens-usernames") + if contract != nil: + return $contract.address + result = "" type ENSType* {.pure.} = enum