From ccb50a7ee976dcce481d07bb129a489380d4c247 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 21 Feb 2017 01:51:08 -0800 Subject: [PATCH] add one missing self.destroyed check --- server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server.js b/server.js index 9186c46..8548786 100644 --- a/server.js +++ b/server.js @@ -545,6 +545,7 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) { debug('got answer %s from %s', JSON.stringify(params.answer), params.peer_id) self.getSwarm(params.info_hash, function (err, swarm) { + if (self.destroyed) return if (err) return self.emit('warning', err) if (!swarm) { return self.emit('warning', new Error('no swarm with that `info_hash`'))