cloudflare: result is now null and not empty array
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user