Add check to that innerException is empty

pull/500/head
hadashiA 2023-09-14 16:08:32 +09:00
parent 62a2a2e8f9
commit 90c81613ac
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ namespace Cysharp.Threading.Tasks
p.TrySetCanceled(); p.TrySetCanceled();
break; break;
case TaskStatus.Faulted: case TaskStatus.Faulted:
p.TrySetException(x.Exception.InnerException); p.TrySetException(x.Exception.InnerException ?? x.Exception);
break; break;
case TaskStatus.RanToCompletion: case TaskStatus.RanToCompletion:
p.TrySetResult(x.Result); p.TrySetResult(x.Result);
@ -58,7 +58,7 @@ namespace Cysharp.Threading.Tasks
p.TrySetCanceled(); p.TrySetCanceled();
break; break;
case TaskStatus.Faulted: case TaskStatus.Faulted:
p.TrySetException(x.Exception.InnerException); p.TrySetException(x.Exception.InnerException ?? x.Exception);
break; break;
case TaskStatus.RanToCompletion: case TaskStatus.RanToCompletion:
p.TrySetResult(); p.TrySetResult();