From 307a5414803adac403589a2ed125af031c42e20e Mon Sep 17 00:00:00 2001 From: Victor Sklyar Date: Wed, 15 Feb 2023 18:22:29 +0200 Subject: [PATCH 1/2] Update Browser.js --- src/Browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Browser.js b/src/Browser.js index 097d591..31915fc 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -104,7 +104,7 @@ Browser.prototype.stop = function() { // because resolver.stop()'s will trigger serviceDown: this.removeAllListeners('serviceDown'); - Object.values(this._resolvers).forEach(resolver => resolver.stop()); + Object.values(this._resolvers).forEach(resolver => resolver && resolver.stop()); this._state = STATE.STOPPED; this._resolvers = {}; From e22d508aff51a32ff3bee6f917efc2b0078c3d57 Mon Sep 17 00:00:00 2001 From: Victor Sklyar Date: Wed, 15 Feb 2023 18:23:03 +0200 Subject: [PATCH 2/2] Update Browser.js --- lib/Browser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Browser.js b/lib/Browser.js index b9df27d..1491d06 100644 --- a/lib/Browser.js +++ b/lib/Browser.js @@ -110,7 +110,7 @@ Browser.prototype.stop = function () { // because resolver.stop()'s will trigger serviceDown: this.removeAllListeners('serviceDown'); Object.values(this._resolvers).forEach(function (resolver) { - return resolver.stop(); + return resolver && resolver.stop(); }); this._state = STATE.STOPPED; @@ -258,4 +258,4 @@ Browser.prototype._addService = function (answer, additionals) { resolver.start(additionals); }; -module.exports = Browser; \ No newline at end of file +module.exports = Browser;