From d2027d2e5a634b370e64eec557e4bfab34004464 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Fri, 12 Sep 2014 11:49:30 -0500 Subject: [PATCH] Fix /unmute with empty name --- lib/channel/chat.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/channel/chat.js b/lib/channel/chat.js index 8bce8874..43cf1408 100644 --- a/lib/channel/chat.js +++ b/lib/channel/chat.js @@ -537,7 +537,14 @@ ChatModule.prototype.handleCmdUnmute = 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: "/unmute requires a target name" + }); + return; + } + name = name.toLowerCase(); if (!this.isMuted(name)) { user.socket.emit("errorMsg", {