Merge pull request #2848 from thelounge/xpaw/harden-inputs

Make sure registered command is actually a function
This commit is contained in:
Pavel Djundik 2018-10-13 13:11:49 +03:00 committed by GitHub
commit f1c84c1ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -354,7 +354,7 @@ Client.prototype.inputLine = function(data) {
const irc = target.network.irc; const irc = target.network.irc;
let connected = irc && irc.connection && irc.connection.connected; let connected = irc && irc.connection && irc.connection.connected;
if (cmd in inputs) { if (inputs.hasOwnProperty(cmd) && typeof inputs[cmd].input === "function") {
const plugin = inputs[cmd]; const plugin = inputs[cmd];
if (connected || plugin.allowDisconnected) { if (connected || plugin.allowDisconnected) {