diff --git a/lib/server.js b/lib/server.js index 81ca446..ae43815 100644 --- a/lib/server.js +++ b/lib/server.js @@ -46,7 +46,9 @@ module.exports = function(options) { logger.warn(format('Forcefully stopping server on %s:%d', config.host, config.port)) server.destroy(cb) }, duration(config.shutdown.delay)) - destroy.unref() + if(destroy instanceof Object){ + destroy.unref() + } } function close(cb) {