From bcb2823cd0a46f0f41985d7e2f64962299dcd643 Mon Sep 17 00:00:00 2001 From: Roi Atalla Date: Sat, 25 Jun 2016 01:54:19 -0700 Subject: [PATCH 1/2] Added a check for existence of channel.modeParams[mode] --- lib/irc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irc.js b/lib/irc.js index 5abc7f77..c45c3dbc 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -294,7 +294,7 @@ function Client(server, nick, opt) { } else { channel.modeParams[mode] = [param]; } - } else { + } else if(channel.modeParams[mode]) { if (arr) { channel.modeParams[mode] = channel.modeParams[mode] .filter(function(v) { return v !== param[0]; }); From 141d925673e6f2fd4ca6f0cbf5190fc756c06b35 Mon Sep 17 00:00:00 2001 From: Roi Atalla Date: Sat, 25 Jun 2016 02:00:10 -0700 Subject: [PATCH 2/2] Added space after if to conform with code guidelines --- lib/irc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irc.js b/lib/irc.js index c45c3dbc..4617c120 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -294,7 +294,7 @@ function Client(server, nick, opt) { } else { channel.modeParams[mode] = [param]; } - } else if(channel.modeParams[mode]) { + } else if (channel.modeParams[mode]) { if (arr) { channel.modeParams[mode] = channel.modeParams[mode] .filter(function(v) { return v !== param[0]; });