mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 02:21:36 +00:00
fixes for simple-websocket@4
This commit is contained in:
parent
de234ac8b0
commit
ad580c3d7c
@ -128,8 +128,11 @@ WebSocketTracker.prototype._onSocketData = function (data) {
|
||||
var self = this
|
||||
if (self.destroyed) return
|
||||
|
||||
if (!(typeof data === 'object' && data !== null)) {
|
||||
return self.client.emit('warning', new Error('Invalid tracker response'))
|
||||
try {
|
||||
data = JSON.parse(data)
|
||||
} catch (err) {
|
||||
self.client.emit('warning', new Error('Invalid tracker response'))
|
||||
return
|
||||
}
|
||||
|
||||
if (data.info_hash !== self.client._infoHashBinary) {
|
||||
|
Loading…
Reference in New Issue
Block a user