diff --git a/src/plugins/inputs/query.js b/src/plugins/inputs/query.js index 49c01107..6d9d3a26 100644 --- a/src/plugins/inputs/query.js +++ b/src/plugins/inputs/query.js @@ -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;