From a0fd56d7b3d6c2921bbf19b8c4aaef722e1368b3 Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Tue, 24 Jun 2014 13:25:21 -0500 Subject: [PATCH] Fix reconnect abort logic on client.destroy() --- lib/client/client.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/client/client.js b/lib/client/client.js index 648581b..27f0202 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -940,9 +940,11 @@ Client.prototype._connect = function _connect() { } this.connecting = true; retry.start(); - // Abbord reconnection attemps if client is destroyed + // Abort reconnection attempts if client is destroyed this.on('destroy', function () { - retry.abort(); + if (retry.isRunning()) { + retry.abort(); + } }); };