node-slackbot icon indicating copy to clipboard operation
node-slackbot copied to clipboard

TypeError: Cannot read property 'url' of null

Open suresh1271 opened this issue 7 years ago • 1 comments

Hi @rmcdaniel , I tried your code in Runkit.com and working fine. But when I try to run in my local machine I am facing the below error. Can you please give me suitable solution for this below error.

**D:\app\nodejs\New folder\node-slackbot-master\node_modules\node-slackbot\lib\sla ckbot.js:93 self.ws = new ws(data.url); ^

TypeError: Cannot read property 'url' of null at D:\app\nodejs\New folder\node-slackbot-master\node_modules\node-slackbot
lib\slackbot.js:93:28 at ClientRequest. (D:\app\nodejs\New folder\node-slackbot-master
node_modules\node-slackbot\lib\slackbot.js:55:14) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) at emitErrorNT (net.js:1277:8) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)**

suresh1271 avatar Sep 15 '17 10:09 suresh1271

Yes I got this error too sometime. I think this is because this line was triggered by https://github.com/rmcdaniel/node-slackbot/blob/master/lib/slackbot.js#L44 or https://github.com/rmcdaniel/node-slackbot/blob/master/lib/slackbot.js#L55. And at this line https://github.com/rmcdaniel/node-slackbot/blob/master/lib/slackbot.js#L92 cb is called without data fulfilled then we got error. So before we go into https://github.com/rmcdaniel/node-slackbot/blob/master/lib/slackbot.js#L93 we should check error.

ghost avatar Sep 04 '18 14:09 ghost