Skip to content

Commit

Permalink
missed a check is drain callback exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-page committed Nov 24, 2014
1 parent 03702bb commit 0ba8c6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0ba8c6b

Please sign in to comment.