[fix] Dont allow async.forEach to be called on undefined or null arrays

This commit is contained in:
indexzero 2011-04-13 18:49:38 -04:00
parent 7484fdb7a0
commit d99ab32cc5

View file

@ -292,6 +292,7 @@ Redis.prototype.load = function (callback) {
});
}
keys = keys || [];
async.forEach(keys, addValue, function (err) {
return err ? callback(err) : callback(null, result);
});
@ -317,6 +318,7 @@ Redis.prototype.reset = function (callback) {
return callback(err);
}
existing = existing || [];
async.forEach(existing, function (key, next) {
self.clear(key, next);
}, callback);