diff --git a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js index ce9746aa3..695d98574 100644 --- a/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js +++ b/packages/node_modules/@node-red/nodes/core/network/10-mqtt.js @@ -941,15 +941,14 @@ module.exports = function(RED) { * * If `handler` is omitted, then all events named `event` are removed * * If both parameters are omitted, then all events are removed * @param {string} [event] The name of the event (optional) - * @param {function} [handler] The handler for this event + * @param {function} [handler] The handler for this event (optional) */ node._clientRemoveListeners = function(event, handler) { node.clientListeners = node.clientListeners.filter((l) => { - if (event && event !== l.e) { return true; } - if (handler && handler !== l.h) { return true; } - node.client.removeListener(l.event, l.f) - return false; //found and removed, fliter out this one - + if (event && event !== l.event) { return true; } + if (handler && handler !== l.handler) { return true; } + node.client.removeListener(l.event, l.handler) + return false; //found and removed, filter out this one }) }