Fix /unmute with empty name
This commit is contained in:
parent
731ab3f9a5
commit
d2027d2e5a
|
|
@ -537,7 +537,14 @@ ChatModule.prototype.handleCmdUnmute = function (user, msg, meta) {
|
||||||
var args = msg.split(" ");
|
var args = msg.split(" ");
|
||||||
args.shift(); /* shift off /mute */
|
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)) {
|
if (!this.isMuted(name)) {
|
||||||
user.socket.emit("errorMsg", {
|
user.socket.emit("errorMsg", {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue