diff --git a/commands/verify.js b/commands/verify.js index 1d4ba0066761691f29f13bd7eeac33fa7d96410f..55514c4b6794785d577dd2c06a9216f616c12c07 100644 --- a/commands/verify.js +++ b/commands/verify.js @@ -58,7 +58,12 @@ module.exports = { const apiResponse = await getContent(apiurl); - return JSON.parse(apiResponse).table1.table1_Product_Collection.table1_Product[0].Detail_Collection.Detail; + // Check to see if we only get one type of member + if (apiResponse.table1.table1_Product_Collection.table1_Product[0] === undefined) { + return JSON.parse(apiResponse).table1.table1_Product_Collection.table1_Product.Detail_Collection.Detail; + } else { + return JSON.parse(apiResponse).table1.table1_Product_Collection.table1_Product[0].Detail_Collection.Detail; + } } /**