diff --git a/src/dns/cloudflare.js b/src/dns/cloudflare.js index 286f7e719..005800b03 100644 --- a/src/dns/cloudflare.js +++ b/src/dns/cloudflare.js @@ -103,6 +103,7 @@ async function getDnsRecords(domainConfig, zoneId, fqdn, type) { if (response.statusCode !== 200 || response.body.success !== true) throw translateRequestError(response); const result = response.body.result; + if (result === null) return []; // sometime about now, cloudflare API has started returning null instead of empty array if (!Array.isArray(result)) throw new BoxError(BoxError.EXTERNAL_ERROR, `result is not an array when getting records: ${response.statusCode} ${response.text}`); return result; }