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`'))