diff --git a/lib/udp-tracker.js b/lib/udp-tracker.js index 0f0fb25..1ad5f3c 100644 --- a/lib/udp-tracker.js +++ b/lib/udp-tracker.js @@ -82,6 +82,7 @@ UDPTracker.prototype._request = function (opts) { var socket = dgram.createSocket('udp4') var cleanup = function () { + if (!socket) return self._cleanupFns.splice(self._cleanupFns.indexOf(cleanup), 1) if (timeout) { clearTimeout(timeout)