Fixed an issue related to reconnect on JBNC, sometimes it reads "undefined" joins as reported on https://github.com/freenode/jbnc/issues/52
With this correction I haven't seen any for 2 days.
if(connection.channels.hasOwnProperty(key)) {
_channel=connection.channels[key];
- if (_channel.name != "undefined" || typeof _channel.name !== 'undefined') {
+ if (_channel && _channel.name) {
socket.write("@time="+new Date().toISOString()+";msgid=back :"+connection.nick+"!"+connection.ircuser+"@"+connection.host+" JOIN :"+_channel.name+"\n");
} else {
continue;