Skip to content

Commit

Permalink
Show warning when the results is not an array
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Oct 17, 2022
1 parent 2ac1574 commit dcec243
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ class BrokerBin {
result: []
}]
}
const results = res.resultset[0].result
const results = res && res.resultset && res.resultset[0] && res.resultset[0].result
if (!Array.isArray(results)) {
console.warn(`Brokerbin result is not an array.`, results)
console.warn(results)
results = []
}
resolve(results)
})
})
Expand Down

0 comments on commit dcec243

Please sign in to comment.