1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-26 00:12:28 +08:00

Mark access to exception if task faulted as safe

There are seemingly no C#-side compile-time guarantees that it is safe,
but if the task's state is `Faulted` (as is checked right before), the
exception cannot be null as per the documentation.
This commit is contained in:
Bartłomiej Dach
2021-05-14 23:42:56 +02:00
Unverified
parent f2d0f7db99
commit 43c73f9583
+2 -1
View File
@@ -6,6 +6,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Extensions.ObjectExtensions;
namespace osu.Game.Extensions
{
@@ -50,7 +51,7 @@ namespace osu.Game.Extensions
}
else if (continuationTask.IsFaulted)
{
tcs.TrySetException(continuationTask.Exception);
tcs.TrySetException(continuationTask.Exception.AsNonNull());
}
else
{