From 749cd8ac1f09e71f603ae92682185cbeabaa125b Mon Sep 17 00:00:00 2001 From: Olli Vanhoja Date: Tue, 16 Aug 2016 00:28:32 +0300 Subject: [PATCH] domain add: Try fallback if the list of name servers is empty (#111) --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index e834998..4bac1be 100644 --- a/lib/index.js +++ b/lib/index.js @@ -354,7 +354,7 @@ export default class Now extends EventEmitter { if (this._debug) console.timeEnd(`> [debug] #${attempt} GET /whois-ns${fallback ? '-fallback' : ''}`); const body = await res.json(); if (200 === res.status) { - if (!body.nameservers && !fallback) { + if ((!body.nameservers || body.nameservers.length === 0) && !fallback) { // if the nameservers are `null` it's likely // that our whois service failed to parse it return this.getNameservers(domain, { fallback: true });