diff --git a/.gitignore b/.gitignore index 4743e9d..8b4dde6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ npm-debug.log node_modules/ *.sublime-* .idea/ +/test.js diff --git a/README.md b/README.md index a0b2a1c..71852ff 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ Release the connect back to the pool to be used again ## Changelog +### Version 1.0.3 +* bug fix only + ### Version 1.0.3 * Pool modifies the Tedious connection object rather than the Connection prototype. diff --git a/lib/connection-pool.js b/lib/connection-pool.js index f6fe152..8679fa8 100755 --- a/lib/connection-pool.js +++ b/lib/connection-pool.js @@ -239,6 +239,9 @@ ConnectionPool.prototype.release = function(connection) { if (pooled.con === connection) { //reset connection & release it connection.reset(function (err) { + if (!pooled.con) //the connection failed during the reset + return; + if (err) { //there is an error, don't reuse the connection, just close it pooled.con.close(); return;