mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Make sure array promises pass through undefined
This commit is contained in:
@@ -85,7 +85,9 @@ function lodashAsPromised($q) {
|
|||||||
|
|
||||||
function wrapCallback(method, callback, thisArg, collection) {
|
function wrapCallback(method, callback, thisArg, collection) {
|
||||||
return method(collection, function(value, index, 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));
|
return value.then(_.partialRight(callback, index, collection));
|
||||||
} else {
|
} else {
|
||||||
return callback(value, index, collection);
|
return callback(value, index, collection);
|
||||||
|
|||||||
Reference in New Issue
Block a user