diff --git a/clients/pool.js b/clients/pool.js index 2c8c885e..067066b9 100644 --- a/clients/pool.js +++ b/clients/pool.js @@ -80,10 +80,14 @@ define(function(require, exports) { // Tear down the pool, only necessary if you need it. destroy: function(callback) { var poolInstance = this.poolInstance; - poolInstance.drain(function() { - poolInstance.destroyAllNow(callback); - }); - delete this.poolInstance; + if (poolInstance) { + poolInstance.drain(function() { + poolInstance.destroyAllNow(callback); + }); + delete this.poolInstance; + } else { + callback(); + } return this; }