From c8684d58ed3738bef5ef7b586011bd6a4b6d051a Mon Sep 17 00:00:00 2001 From: calzoneman Date: Fri, 22 Aug 2014 10:52:15 -0500 Subject: [PATCH] Fix handling of /mute with no name --- lib/channel/chat.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/channel/chat.js b/lib/channel/chat.js index 0a1731d8..606d83b7 100644 --- a/lib/channel/chat.js +++ b/lib/channel/chat.js @@ -426,7 +426,15 @@ ChatModule.prototype.handleCmdMute = function (user, msg, meta) { var args = msg.split(" "); args.shift(); /* shift off /mute */ - var name = args.shift().toLowerCase(); + var name = args.shift(); + if (typeof name !== "string") { + user.socket.emit("errorMsg", { + msg: "/mute requires a target name" + }); + return; + } + name = name.toLowerCase(); + var target; for (var i = 0; i < this.channel.users.length; i++) {