diff --git a/Implab/Parallels/ArrayTraits.cs b/Implab/Parallels/ArrayTraits.cs --- a/Implab/Parallels/ArrayTraits.cs +++ b/Implab/Parallels/ArrayTraits.cs @@ -133,6 +133,9 @@ namespace Implab.Parallels { if (threads <= 0) throw new ArgumentOutOfRangeException("Threads number must be greater then zero"); + if (source.Length == 0) + return Promise.ResultToPromise(new TDst[0]); + var promise = new Promise(); var res = new TDst[source.Length]; var pending = source.Length; diff --git a/Implab/Promise.cs b/Implab/Promise.cs --- a/Implab/Promise.cs +++ b/Implab/Promise.cs @@ -236,7 +236,7 @@ namespace Implab { public IPromiseBase Then(Action success) { - return Then(success); + return Then(x => success()); } ///