diff --git a/lib/bus.js b/lib/bus.js index 277491c..40de03d 100644 --- a/lib/bus.js +++ b/lib/bus.js @@ -483,7 +483,7 @@ class MessageBus extends EventEmitter { } _addMatch (match) { - if (Object.prototype.hasOwnProperty.call(match, this._matchRules)) { + if (Object.prototype.hasOwnProperty.call(this._matchRules, match)) { this._matchRules[match] += 1; return Promise.resolve(); } @@ -507,7 +507,7 @@ class MessageBus extends EventEmitter { return Promise.resolve(); } - if (Object.prototype.hasOwnProperty.call(match, this._matchRules)) { + if (Object.prototype.hasOwnProperty.call(this._matchRules, match)) { this._matchRules[match] -= 1; if (this._matchRules[match] > 0) { return Promise.resolve();