Skip to content
Browse files

Merge pull request #8 from demian85/patch-2

Fix infinite loop if no callback provided.
  • Loading branch information...
2 parents dc8adb2 + 5a47488 commit 265662ddf63a881f55f7b1981795071d655d8e65 @Kijewski committed Sep 7, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mysql-pool/pool.js
View
2 lib/mysql-pool/pool.js
@@ -74,7 +74,7 @@ MySQLPool.prototype._forEach = function _forEach(params) {
// TODO: callback _once_
var pool = this;
var args = Array.prototype.slice.call(params.args);
- while(typeof args[args.length-1] == "undefined") {
+ while(args.length && typeof args[args.length-1] == "undefined") {
args.pop();
}
var cb = args.pop();

0 comments on commit 265662d

Please sign in to comment.
Something went wrong with that request. Please try again.