diff --git a/Source/Concurrency/Promise/Composition/PromiseAll.swift b/Source/Concurrency/Promise/Composition/PromiseAll.swift index 8e34346..8c58f92 100644 --- a/Source/Concurrency/Promise/Composition/PromiseAll.swift +++ b/Source/Concurrency/Promise/Composition/PromiseAll.swift @@ -30,7 +30,7 @@ extension Promise where promiseReturn.resolve(values) } - promises.forEach { promise in + for promise in promises { promise.subscribe( queue: promise.queue, onResolved: { _ in resolve() }, @@ -39,6 +39,10 @@ extension Promise where ) } + if promises.isEmpty { + resolve() + } + return promiseReturn }