mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 06:20:26 +00:00
Merge pull request #1676 from realies/patch-1
handle empty client queries
This commit is contained in:
commit
3af9a45087
1 changed files with 6 additions and 2 deletions
|
@ -7,11 +7,15 @@ var Msg = require("../../models/msg");
|
|||
exports.commands = ["query"];
|
||||
|
||||
exports.input = function(network, chan, cmd, args) {
|
||||
if (args.length === 0) {
|
||||
var target = args[0];
|
||||
if (args.length === 0 || target.length === 0) {
|
||||
chan.pushMessage(this, new Msg({
|
||||
type: Msg.Type.ERROR,
|
||||
text: "You cannot open a query window without an argument.",
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
var target = args[0];
|
||||
var query = _.find(network.channels, {name: target});
|
||||
if (typeof query !== "undefined") {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue