Skip to content

Commit b5d8748

Browse files
committed
fix crash on invalid udp tracker response
1 parent 7ea2a13 commit b5d8748

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/udp-tracker.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ UDPTracker.prototype._request = function (opts) {
8282
var socket = dgram.createSocket('udp4')
8383

8484
var cleanup = function () {
85+
if (!socket) return
8586
self._cleanupFns.splice(self._cleanupFns.indexOf(cleanup), 1)
8687
if (timeout) {
8788
clearTimeout(timeout)

0 commit comments

Comments
 (0)