[fix] Dont allow async.forEach
to be called on undefined or null arrays
This commit is contained in:
parent
7484fdb7a0
commit
d99ab32cc5
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue