1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 01:22:59 +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
parent f2d0f7db99
commit 43c73f9583

View File

@ -6,6 +6,7 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.Extensions.ObjectExtensions;
namespace osu.Game.Extensions namespace osu.Game.Extensions
{ {
@ -50,7 +51,7 @@ namespace osu.Game.Extensions
} }
else if (continuationTask.IsFaulted) else if (continuationTask.IsFaulted)
{ {
tcs.TrySetException(continuationTask.Exception); tcs.TrySetException(continuationTask.Exception.AsNonNull());
} }
else else
{ {