1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:43:01 +08:00

Handle cancellation at more points during Player initialisation

As discussed in discord, this will help avoid null references during
cancellation which can otherwise be quite confusing to debug.
This commit is contained in:
Dean Herbert 2022-08-09 23:25:19 +09:00
parent d59f4720f1
commit a5081826b7

View File

@ -249,6 +249,9 @@ namespace osu.Game.Screens.Play
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
GameplayClockContainer.Add(rulesetSkinProvider);
if (cancellationToken.IsCancellationRequested)
return;
rulesetSkinProvider.AddRange(new Drawable[]
{
failAnimationLayer = new FailAnimation(DrawableRuleset)
@ -279,6 +282,9 @@ namespace osu.Game.Screens.Play
},
});
if (cancellationToken.IsCancellationRequested)
return;
if (Configuration.AllowRestart)
{
rulesetSkinProvider.Add(new HotkeyRetryOverlay