Fail earlier when resolving an ENS name that is not a string.

This commit is contained in:
Richard Moore 2020-04-03 21:32:44 -04:00
parent 6526de016f
commit 2882546351
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

View File

@ -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; }