Skip to content

Commit

Permalink
Merge pull request #236 from qq99/master
Browse files Browse the repository at this point in the history
Fixes #235 type error where channel does not exist
  • Loading branch information
Fionn Kelleher committed May 29, 2014
2 parents 574f2b0 + 70db2d4 commit 61105b8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ function Client(server, nick, opt) {
}
else {
var channel = self.chanData(message.args[0]);
channel.users[message.nick] = '';
if (channel && channel.users) {
channel.users[message.nick] = '';
}
}
self.emit('join', message.args[0], message.nick, message);
self.emit('join' + message.args[0], message.nick, message);
Expand All @@ -430,7 +432,9 @@ function Client(server, nick, opt) {
}
else {
var channel = self.chanData(message.args[0]);
delete channel.users[message.nick];
if (channel && channel.users) {
delete channel.users[message.nick];
}
}
break;
case "KICK":
Expand All @@ -447,7 +451,9 @@ function Client(server, nick, opt) {
}
else {
var channel = self.chanData(message.args[0]);
delete channel.users[message.args[1]];
if (channel && channel.users) {
delete channel.users[message.args[1]];
}
}
break;
case "KILL":
Expand Down

0 comments on commit 61105b8

Please sign in to comment.