node-irc
node-irc copied to clipboard
TypeError: Cannot read property 'requestedDisconnect' of null
Hi I got this error
TypeError: Cannot read property 'requestedDisconnect' of null at Client.send (/data/project/lolrrit-wm/lolrrit-wm/node_modules/irc/lib/irc.js:932:19) at dequeue (/data/project/lolrrit-wm/lolrrit-wm/node_modules/irc/lib/irc.js:962:22) at wrapper [as _onTimeout] (timers.js:275:11) at Timer.listOnTimeout (timers.js:92:15)
Possible fix proposed in #477
Oh thankyou
I manually applied the patch in #477 to solve this 'requestedDisconnect' issue but I am still seeing the same behavior.
@ahti123 looking at that, that shows a different error compared to here.
There it says 'readyState' whereas here shows 'requestedDisconnect'
Yep, my bad, I have a "TypeError: Cannot read property 'requestedDisconnect' of null" too and the fix I pointed here does not work for me, too :)
This is working for me so far but I have not looked into it for any consequences.
diff --git a/irc.js b/irc.js
index 5a21d0a..28abcd9 100644
--- a/irc.js
+++ b/irc.js
@@ -935,7 +935,7 @@ Client.prototype.send = function(command) {
if (this.opt.debug)
util.log('SEND: ' + args.join(' '));
- if (this.conn && this.conn.requestedDisconnect) {
+ if (this.conn && !this.conn.requestedDisconnect) {
this.conn.write(args.join(' ') + '\r\n');
}
};
Also seen a similar issue with node-irc v0.5.2 and node v6.9.1.
TypeError: Cannot read property 'requestedDisconnect' of null
at Client.send (/path/to/node_modules/irc/lib/irc.js:936:19)
at Timeout.dequeue [as _onTimeout] (/path/to/node_modules/irc/lib/irc.js:966:22)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
But, I could avoid this by using node-irc v0.3.7