mirror of
https://github.com/osukey/osukey.git
synced 2025-06-10 05:48:05 +09:00
Fix hard crashes on tournament client if a round contains an empty beatmap
This commit is contained in:
parent
3f2512295c
commit
55ed823c88
@ -223,15 +223,22 @@ namespace osu.Game.Tournament
|
|||||||
|
|
||||||
foreach (var r in ladder.Rounds)
|
foreach (var r in ladder.Rounds)
|
||||||
{
|
{
|
||||||
foreach (var b in r.Beatmaps)
|
foreach (var b in r.Beatmaps.ToList())
|
||||||
{
|
{
|
||||||
if (b.BeatmapInfo == null && b.ID > 0)
|
if (b.BeatmapInfo == null)
|
||||||
{
|
{
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
if (b.ID > 0)
|
||||||
API.Perform(req);
|
{
|
||||||
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||||
|
API.Perform(req);
|
||||||
|
b.BeatmapInfo = req.Result?.ToBeatmap(RulesetStore);
|
||||||
|
|
||||||
addedInfo = true;
|
addedInfo = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b.BeatmapInfo == null)
|
||||||
|
// if online population couldn't be performed, ensure we don't leave a null value behind
|
||||||
|
r.Beatmaps.Remove(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user