Fix handling of /mute with no name

This commit is contained in:
calzoneman 2014-08-22 10:52:15 -05:00
parent 53971af737
commit c8684d58ed
1 changed files with 9 additions and 1 deletions

View File

@ -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++) {