Chris-Cullins / bittrex-scanner

2 stars 1 forks source link

TypeError: Cannot read property 'length' of null #1

Open imatimba opened 6 years ago

imatimba commented 6 years ago

Hi, first of all thanks for coding this. I'm testing how this signal bot works and I'm getting an error after a few minutes of running.

D:\Git\bittrex-scanner\modules\fetchPrice.js:124
            for (var i = 0; i < data.result.length; i++) {
                                           ^

TypeError: Cannot read property 'length' of null
    at D:\Git\bittrex-scanner\modules\fetchPrice.js:124:44
    at Request._callback (D:\Git\bittrex-scanner\node_modules\node.bittrex.api\node.bittrex.api.js:135:15)
    at Request.self.callback (D:\Git\bittrex-scanner\node_modules\request\request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (D:\Git\bittrex-scanner\node_modules\request\request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (D:\Git\bittrex-scanner\node_modules\request\request.js:1085:12)
    at IncomingMessage.g (events.js:292:16)

Using default options. Tested on Windows 10 and Ubuntu 16.04 with Node.js LTS v6.11.3. No other message on the console before that, main.log empty, and stoch.log exists with a lot of info lines about all the pairs it's checking but no errors. Tried uncommenting the console.log(data) on line 98 and 117 of fetchPrice.js and it seems like the api call returns result null before the error happens.

{ success: true, message: '', result: null }

Chris-Cullins commented 6 years ago

Hi, I'll take a look when I get home. I remember seeing this a few times when I was turning this application into a 'trading bot' (which I've got private :) ) and that bot has a ton more work done to it than this project. But I'll try to figure out all of these bugs in here as well. Will let you know what I find.

Also, sorry for the late response, I didn't realized anyone was actually using this.... haha. Funny how that happens. You include 'bittrex' in your title and all of a sudden you've got users!

imatimba commented 6 years ago

Hey thanks, no problem.
Yeah I've been searching for repos with bittrex in the name for code/strategies examples.