From 0ba8c6bf960754b904fbe13d5c7ffcb91ac7b015 Mon Sep 17 00:00:00 2001 From: Ben Page Date: Mon, 24 Nov 2014 14:04:25 -0600 Subject: [PATCH] missed a check is drain callback exists --- lib/connection-pool.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/connection-pool.js b/lib/connection-pool.js index c2d96f1..fb7b133 100644 --- a/lib/connection-pool.js +++ b/lib/connection-pool.js @@ -254,7 +254,8 @@ ConnectionPool.prototype.release = function(connection) { ConnectionPool.prototype.drain = function (callback) { this.log('draining pool'); if (this.drained) {//pool has been drained - callback(); + if (callback) + callback(); return; }