# HG changeset patch # User cin # Date 2014-04-08 19:25:01 # Node ID 8eca2652d2ff9617fb00fa7b9c78f4038ade95cc # Parent dafaadca5b9f27ead926b8ffb3565d753e8f6722 fixed: StackOverflow in IPromiseBase.Then(handler) fixed: hang in ChainMap method on empty arrays 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()); } ///