Fix /unmute with empty name

This commit is contained in:
calzoneman 2014-09-12 11:49:30 -05:00
parent 731ab3f9a5
commit d2027d2e5a
1 changed files with 8 additions and 1 deletions

View File

@ -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", {