ws tracker: don't crash with filter function

This commit is contained in:
Feross Aboukhadijeh 2016-02-29 17:35:04 -08:00
parent 2abab6c653
commit 5dcdf9c4c1

View File

@ -325,10 +325,13 @@ Server.prototype._onWebSocketRequest = function (socket, params) {
self._onRequest(params, function (err, response) {
if (err) {
socket.send(JSON.stringify({
'failure reason': err.message,
info_hash: common.hexToBinary(params.info_hash)
}), socket.onSend)
self.emit('warning', err)
response = {
'failure reason': err.message
}
return
}
if (self.destroyed) return