Replace usage of .Result with .WaitSafelyForResult

This commit is contained in:
Dean Herbert
2022-01-03 17:31:12 +09:00
parent 031a40af6a
commit 73b40e6833
41 changed files with 121 additions and 68 deletions

View File

@ -7,6 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -79,14 +80,16 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
};
scoreManager.OrderByTotalScoreAsync(value.Scores.Select(s => s.CreateScoreInfo(rulesets, beatmapInfo)).ToArray(), loadCancellationSource.Token)
.ContinueWith(ordered => Schedule(() =>
.ContinueWith(task => Schedule(() =>
{
if (loadCancellationSource.IsCancellationRequested)
return;
var topScore = ordered.Result.First();
var scores = task.WaitSafelyForResult();
scoreTable.DisplayScores(ordered.Result, apiBeatmap.Status.GrantsPerformancePoints());
var topScore = scores.First();
scoreTable.DisplayScores(scores, apiBeatmap.Status.GrantsPerformancePoints());
scoreTable.Show();
var userScore = value.UserScore;