Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDC <dcposch@dcpos.ch>2016-09-05 01:20:58 +0300
committerDC <dcposch@dcpos.ch>2016-09-05 01:20:58 +0300
commit10ab81db0b929e8f2bf45e8c66935f473c13a50d (patch)
tree218bad33c5bb914dd816ca60a54633f58a6ac5bf /lib/server.js
parent698075243bf6f8fc254b966bfd7dcce0cf3b2ca0 (diff)
Handle no-arg server.destroy(), fixes #899
Diffstat (limited to 'lib/server.js')
-rw-r--r--lib/server.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/server.js b/lib/server.js
index c8d5931..4f1cbbd 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -37,6 +37,7 @@ function Server (torrent, opts) {
})
// Only call `server.close` if user has not called it already
+ if (!cb) cb = function () {}
if (closed) process.nextTick(cb)
else server.close(cb)
}