Skip to content

Commit

Permalink
Merge pull request #46 from mattwebbio/patch-1
Browse files Browse the repository at this point in the history
Fix bug for when Portfolio contains only one item
  • Loading branch information
cdbattags authored Aug 27, 2020
2 parents a3d73f0 + bbefdfb commit 7197f72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions objects/broker/robinhood/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ class User extends Robinhood {
}, (error, response, body) => {
Robinhood.handleResponse(error, response, body, _this.token, res => {
let array = [];

if (!Array.isArray(res)) res = [res];
async.forEachOf(res, (position, key, callback) => {
position.quantity = Number(position.quantity);
if (position.quantity !== 0) {
Expand Down

0 comments on commit 7197f72

Please sign in to comment.