When making a call such as:
hyperwalletManager.getHyperwallet().listUsers({ "email" : emailAddress }, function(err, users){
...
});
A TypeError is thrown when no results are returned, due to the fact that the 204 No Content response does not include a "Content-Type" header.
TypeError: Cannot read property 'indexOf' of undefined
at /Users/aaron/WaitrInc/hyperwallet-node-sdk/src/utils/ApiClient.js:175:88
The following conditional does not check the status code before executing indexOf against the non-existent res.header["content-type"] array.
https://github.com/hyperwallet/node-sdk/blob/master/src/utils/ApiClient.js#L175
I have a PR which fixes this issue and also includes an additional test to cover this case.
When making a call such as:
A TypeError is thrown when no results are returned, due to the fact that the 204 No Content response does not include a "Content-Type" header.
The following conditional does not check the status code before executing
indexOfagainst the non-existentres.header["content-type"]array.https://github.com/hyperwallet/node-sdk/blob/master/src/utils/ApiClient.js#L175
I have a PR which fixes this issue and also includes an additional test to cover this case.