Merge pull request #2848 from thelounge/xpaw/harden-inputs
Make sure registered command is actually a function
This commit is contained in:
commit
f1c84c1ede
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user