Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
fix: Fix orders() method: hasId became null in some cases and method …
Browse files Browse the repository at this point in the history
…failed. (#67)

Easy to reproduce if run this statement:
Robinhood.orders({ updated_at: '2018-01-23' }, function(err, resp, body) { ... }
  • Loading branch information
yura505 authored and aurbano committed May 8, 2018
1 parent bd35b58 commit c365ff1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/robinhood.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function RobinhoodWebApi(opts, callback) {
if (typeof arg === 'object') options = arg; // Keep in mind, instrument option must be the full instrument url!
});

var hasId = typeof id !== "undefined";
var hasId = typeof id !== "undefined" && id !== null;
var hasOptions = _.keys(options).length > 0;

if(hasId && hasOptions){ // remove ambiguitiy from choosing both an id and options
Expand Down

0 comments on commit c365ff1

Please sign in to comment.