Skip to content

Commit

Permalink
Fail earlier when resolving an ENS name that is not a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 4, 2020
1 parent 6526de0 commit 2882546
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/providers/src.ts/base-provider.ts
Expand Up @@ -895,6 +895,10 @@ export class BaseProvider extends Provider {
if (isHexString(name)) { throw error; }
}

if (typeof(name) !== "string") {
logger.throwArgumentError("invalid ENS name", "name", name);
}

// Get the addr from the resovler
const resolverAddress = await this._getResolver(name);
if (!resolverAddress) { return null; }
Expand Down

0 comments on commit 2882546

Please sign in to comment.