diff --git a/Implab/PromiseT.cs b/Implab/PromiseT.cs --- a/Implab/PromiseT.cs +++ b/Implab/PromiseT.cs @@ -349,18 +349,24 @@ namespace Implab { public IPromise Then(Func mapper, Func error, Func cancel) { var promise = new Promise(); + if (mapper != null) + promise.On(Cancel, PromiseEventType.Cancelled); AddHandler(new RemapDescriptor(mapper, error, cancel, promise)); return promise; } public IPromise Then(Func mapper, Func error) { var promise = new Promise(); + if (mapper != null) + promise.On(Cancel, PromiseEventType.Cancelled); AddHandler(new RemapDescriptor(mapper, error, null, promise)); return promise; } public IPromise Then(Func mapper) { var promise = new Promise(); + if (mapper != null) + promise.On(Cancel, PromiseEventType.Cancelled); AddHandler(new RemapDescriptor(mapper, null, null, promise)); return promise; }