From 78f56b9b339476c6e76fd291ccfe32de326a0212 Mon Sep 17 00:00:00 2001 From: neuecc Date: Fri, 22 May 2020 17:15:36 +0900 Subject: [PATCH] OCS --- .../Plugins/UniTask/Runtime/UniTaskCompletionSource.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs index e4d550d..db5d27b 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs @@ -123,7 +123,14 @@ namespace Cysharp.Threading.Tasks { // setup result this.hasUnhandledError = true; - this.error = ExceptionDispatchInfo.Capture(error); + if (error is OperationCanceledException) + { + this.error = error; + } + else + { + this.error = ExceptionDispatchInfo.Capture(error); + } if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null) {