diff --git a/src/dns/cloudflare.js b/src/dns/cloudflare.js index 7ec43ee95..286f7e719 100644 --- a/src/dns/cloudflare.js +++ b/src/dns/cloudflare.js @@ -102,7 +102,9 @@ async function getDnsRecords(domainConfig, zoneId, fqdn, type) { if (error) throw new BoxError(BoxError.NETWORK_ERROR, error.message); if (response.statusCode !== 200 || response.body.success !== true) throw translateRequestError(response); - return response.body.result; + const result = response.body.result; + if (!Array.isArray(result)) throw new BoxError(BoxError.EXTERNAL_ERROR, `result is not an array when getting records: ${response.statusCode} ${response.text}`); + return result; } async function upsert(domainObject, location, type, values) {