1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 18:32:55 +08:00

Fix crash when setting a match as current which doesn't have a grouping

This commit is contained in:
Dean Herbert 2019-06-14 16:23:53 +09:00
parent 831686d20b
commit 2b4384bb30

View File

@ -48,9 +48,9 @@ namespace osu.Game.Tournament.Screens.Schedule
currentMatch.BindTo(ladder.CurrentMatch); currentMatch.BindTo(ladder.CurrentMatch);
} }
private void matchChanged(ValueChangedEvent<MatchPairing> pairing) private void matchChanged(ValueChangedEvent<MatchPairing> match)
{ {
if (pairing.NewValue == null) if (match.NewValue == null)
{ {
mainContainer.Clear(); mainContainer.Clear();
return; return;
@ -110,14 +110,14 @@ namespace osu.Game.Tournament.Screens.Schedule
{ {
Margin = new MarginPadding { Left = -10, Bottom = 10, Top = -5 }, Margin = new MarginPadding { Left = -10, Bottom = 10, Top = -5 },
Spacing = new Vector2(10, 0), Spacing = new Vector2(10, 0),
Text = currentMatch.Value.Grouping.Value.Name.Value, Text = match.NewValue.Grouping.Value?.Name.Value,
Colour = Color4.Black, Colour = Color4.Black,
Font = OsuFont.GetFont(size: 20) Font = OsuFont.GetFont(size: 20)
}, },
new SchedulePairing(currentMatch.Value, false), new SchedulePairing(match.NewValue, false),
new OsuSpriteText new OsuSpriteText
{ {
Text = "Start Time " + pairing.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"), Text = "Start Time " + match.NewValue.Date.Value.ToUniversalTime().ToString("HH:mm UTC"),
Colour = Color4.Black, Colour = Color4.Black,
Font = OsuFont.GetFont(size: 20) Font = OsuFont.GetFont(size: 20)
}, },