From c365ff1c4ddbef64d307e374a47803cfd8929c6d Mon Sep 17 00:00:00 2001 From: Yury Kotlyarov Date: Tue, 8 May 2018 05:49:19 -0500 Subject: [PATCH] fix: Fix orders() method: hasId became null in some cases and method failed. (#67) Easy to reproduce if run this statement: Robinhood.orders({ updated_at: '2018-01-23' }, function(err, resp, body) { ... } --- src/robinhood.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/robinhood.js b/src/robinhood.js index 006daec..2740a57 100644 --- a/src/robinhood.js +++ b/src/robinhood.js @@ -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