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

Merge pull request #2533 from peppy/fix-wedge-nullref

Fix nullref when changing ruleset at main menu
This commit is contained in:
Dean Herbert 2018-05-14 15:19:35 +09:00 committed by GitHub
commit 07fc71e077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,17 +88,27 @@ namespace osu.Game.Screens.Select
private void loadBeatmap()
{
void updateState()
{
State = beatmap == null ? Visibility.Hidden : Visibility.Visible;
Info?.FadeOut(250);
Info?.Expire();
}
if (beatmap == null)
{
updateState();
return;
}
LoadComponentAsync(new BufferedWedgeInfo(beatmap, ruleset.Value)
{
Shear = -Shear,
Depth = Info?.Depth + 1 ?? 0,
}, newInfo =>
{
State = beatmap == null ? Visibility.Hidden : Visibility.Visible;
Info?.FadeOut(250);
Info?.Expire();
updateState();
Add(Info = newInfo);
});
}