mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Merge pull request #7561 from peppy/fix-tournament-null-handling
Fix hard crashes on tournament client if a round contains an empty beatmap
This commit is contained in:
commit
fa1b1479ed
@ -223,9 +223,12 @@ namespace osu.Game.Tournament
|
||||
|
||||
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)
|
||||
continue;
|
||||
|
||||
if (b.ID > 0)
|
||||
{
|
||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = b.ID });
|
||||
API.Perform(req);
|
||||
@ -233,6 +236,10 @@ namespace osu.Game.Tournament
|
||||
|
||||
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…
Reference in New Issue
Block a user