From 1302f9fb486e957d17758f548306d41a99538e4e Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 28 Oct 2019 11:39:41 -0400 Subject: [PATCH] fix(@embark/ens): fix trying to resolve when ENS is not registered --- packages/plugins/ens/src/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/plugins/ens/src/index.js b/packages/plugins/ens/src/index.js index 078b96f9e..67c4cbaa2 100644 --- a/packages/plugins/ens/src/index.js +++ b/packages/plugins/ens/src/index.js @@ -389,10 +389,16 @@ class ENS { } ensResolve(name, cb) { + if (!this.ensContract) { + return cb(__('ENS not registered for this configuration')); + } ENSFunctions.resolveName(name, this.ensContract, this.createResolverContract.bind(this), cb, namehash); } ensLookup(address, cb) { + if (!this.ensContract) { + return cb(__('ENS not registered for this configuration')); + } ENSFunctions.lookupAddress(address, this.ensContract, namehash, this.createResolverContract.bind(this), cb); }