Make sure array promises pass through undefined

This commit is contained in:
Joe Fiorini
2015-06-03 00:10:08 -04:00
parent c24e51f515
commit 0591812da6

View File

@@ -85,7 +85,9 @@ function lodashAsPromised($q) {
function wrapCallback(method, callback, thisArg, collection) {
return method(collection, function(value, index, collection) {
if (_.isFunction(value.then)) {
if (_.isUndefined(value)) {
return callback(value, index, collection);
} else if (_.isFunction(value.then)) {
return value.then(_.partialRight(callback, index, collection));
} else {
return callback(value, index, collection);