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; }