Use GetResultSafely()

This commit is contained in:
cdwcgt 2023-06-26 00:45:59 +09:00
parent 14e26d2a85
commit 1b671b8c6e
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2

View File

@ -9,6 +9,7 @@ using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input;
@ -245,7 +246,7 @@ namespace osu.Game.Tournament
{
var b = beatmapsRequiringPopulation[i];
b.Beatmap = new TournamentBeatmap(beatmapCache.GetBeatmapAsync(b.ID).GetAwaiter().GetResult() ?? new APIBeatmap());
b.Beatmap = new TournamentBeatmap(beatmapCache.GetBeatmapAsync(b.ID).GetResultSafely() ?? new APIBeatmap());
updateLoadProgressMessage($"Populating round beatmaps ({i} / {beatmapsRequiringPopulation.Count})");
}
@ -270,7 +271,7 @@ namespace osu.Game.Tournament
{
var b = beatmapsRequiringPopulation[i];
b.Beatmap = new TournamentBeatmap(beatmapCache.GetBeatmapAsync(b.ID).GetAwaiter().GetResult() ?? new APIBeatmap());
b.Beatmap = new TournamentBeatmap(beatmapCache.GetBeatmapAsync(b.ID).GetResultSafely() ?? new APIBeatmap());
updateLoadProgressMessage($"Populating seeding beatmaps ({i} / {beatmapsRequiringPopulation.Count})");
}