cloudflare: result is now null and not empty array

This commit is contained in:
Girish Ramakrishnan
2024-04-01 17:58:40 +02:00
parent d862f1f5b4
commit 8b0bcde7ec

View File

@@ -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;
}