From 4b1d2c351caca467ee079544ae3d56279ada4dcd Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 22 Sep 2020 08:20:57 +0200 Subject: [PATCH] fix: undefined `this` on connect error (#54) --- persistence.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence.js b/persistence.js index 1b7ecea..fe220b6 100644 --- a/persistence.js +++ b/persistence.js @@ -65,7 +65,7 @@ MongoPersistence.prototype._setup = function () { this._connect(function (err, client) { if (err) { - this.emit('error', err) + that.emit('error', err) return }