cloudflare: fix crash when result is null
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user