Skip to content

Commit 7197f72

Browse files
authored
Merge pull request #46 from mattwebbio/patch-1
Fix bug for when Portfolio contains only one item
2 parents a3d73f0 + bbefdfb commit 7197f72

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

objects/broker/robinhood/User.js

+2
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,8 @@ class User extends Robinhood {
619619
}, (error, response, body) => {
620620
Robinhood.handleResponse(error, response, body, _this.token, res => {
621621
let array = [];
622+
623+
if (!Array.isArray(res)) res = [res];
622624
async.forEachOf(res, (position, key, callback) => {
623625
position.quantity = Number(position.quantity);
624626
if (position.quantity !== 0) {

0 commit comments

Comments
 (0)