From be4b93ea2a8f7218e32ea273fafceb0afc53d53c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 19 Jul 2023 14:51:42 +0200 Subject: [PATCH] namecheap: ensure we don't fail if no dns records exist --- src/dns/namecheap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns/namecheap.js b/src/dns/namecheap.js index 55bb77334..3f82788f6 100644 --- a/src/dns/namecheap.js +++ b/src/dns/namecheap.js @@ -70,7 +70,7 @@ async function getZone(domainConfig, zoneName) { throw new BoxError(BoxError.EXTERNAL_ERROR, errorMessage); } - const host = safe.query(tmp, 'CommandResponse[0].DomainDNSGetHostsResult[0].host'); + const host = safe.query(tmp, 'CommandResponse[0].DomainDNSGetHostsResult[0].host', []); if (!host) throw new BoxError(BoxError.EXTERNAL_ERROR, `Invalid response: ${JSON.stringify(tmp)}`); if (!Array.isArray(host)) throw new BoxError(BoxError.EXTERNAL_ERROR, `host is not an array: ${JSON.stringify(tmp)}`);