1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Don't crash on unexpected pairing links

This commit is contained in:
Dean Herbert 2018-11-15 14:12:51 +09:00
parent 604cb4cb9e
commit 54b87e9c93

View File

@ -104,7 +104,10 @@ namespace osu.Game.Tournament
// link pairings to groupings
foreach (var group in Ladder.Groupings)
foreach (var id in group.Pairings)
Ladder.Pairings.Single(p => p.ID == id).Grouping.Value = group;
{
var found = Ladder.Pairings.FirstOrDefault(p => p.ID == id);
if (found != null) found.Grouping.Value = group;
}
Ladder.CurrentMatch.Value = Ladder.Pairings.FirstOrDefault(p => p.Current.Value);