Fix /smute with 0 args throwing error
This commit is contained in:
parent
12447ce5dc
commit
ea9fa0a95a
|
@ -487,7 +487,15 @@ ChatModule.prototype.handleCmdSMute = function (user, msg, meta) {
|
||||||
var args = msg.split(" ");
|
var args = msg.split(" ");
|
||||||
args.shift(); /* shift off /smute */
|
args.shift(); /* shift off /smute */
|
||||||
|
|
||||||
var name = args.shift().toLowerCase();
|
var name = args.shift();
|
||||||
|
if (typeof name !== "string") {
|
||||||
|
user.socket.emit("errorMsg", {
|
||||||
|
msg: "/smute requires a target name"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
name = name.toLowerCase();
|
||||||
|
|
||||||
var target;
|
var target;
|
||||||
|
|
||||||
for (var i = 0; i < this.channel.users.length; i++) {
|
for (var i = 0; i < this.channel.users.length; i++) {
|
||||||
|
|
Loading…
Reference in a new issue