From b43f6ffb6fb316e3464f4320767990f086ef1f95 Mon Sep 17 00:00:00 2001 From: Stephen Whitmore Date: Thu, 21 Apr 2016 15:56:38 -0700 Subject: [PATCH] Makes callback optional on close. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index dbb8e5d..bb0f709 100644 --- a/src/index.js +++ b/src/index.js @@ -68,7 +68,7 @@ function TCP () { var count = 0 listeners.forEach((listener) => { listener.close(() => { - if (++count === listeners.length) { + if (++count === listeners.length && callback) { callback() } })