mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 23:12:55 +08:00
Merge pull request #17762 from peppy/fix-unobserved-exceptions
Avoid throwing unobserved exception when `PerformancePointsCounter` requests timed attributes
This commit is contained in:
commit
37976c569a
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
@ -80,13 +79,16 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)
|
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, clonedMods, loadCancellationSource.Token)
|
||||||
.ContinueWith(task => Schedule(() =>
|
.ContinueWith(task => Schedule(() =>
|
||||||
{
|
{
|
||||||
|
if (task.Exception != null)
|
||||||
|
return;
|
||||||
|
|
||||||
timedAttributes = task.GetResultSafely();
|
timedAttributes = task.GetResultSafely();
|
||||||
|
|
||||||
IsValid = true;
|
IsValid = true;
|
||||||
|
|
||||||
if (lastJudgement != null)
|
if (lastJudgement != null)
|
||||||
onJudgementChanged(lastJudgement);
|
onJudgementChanged(lastJudgement);
|
||||||
}), TaskContinuationOptions.OnlyOnRanToCompletion);
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user