1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:03:21 +08:00

Fix missing null checks

This commit is contained in:
Dean Herbert 2018-06-06 18:21:03 +09:00
parent aaaa8a3b7c
commit 9306fec498

View File

@ -322,17 +322,18 @@ namespace osu.Game.Screens.Menu
case MenuState.Initial: case MenuState.Initial:
logoDelayedAction?.Cancel(); logoDelayedAction?.Cancel();
logoDelayedAction = Scheduler.AddDelayed(() => logoDelayedAction = Scheduler.AddDelayed(() =>
{ {
logoTracking = false; logoTracking = false;
game.OverlayActivationMode.Value = state == MenuState.Exit ? OverlayActivation.Disabled : OverlayActivation.UserTriggered; if (game != null)
game.OverlayActivationMode.Value = state == MenuState.Exit ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
logo.ClearTransforms(targetMember: nameof(Position)); logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.Both; logo.RelativePositionAxes = Axes.Both;
logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo);
logo.ScaleTo(1, 800, Easing.OutExpo); logo.ScaleTo(1, 800, Easing.OutExpo);
}, buttonArea.Alpha * 150); }, buttonArea.Alpha * 150);
break; break;
case MenuState.TopLevel: case MenuState.TopLevel:
case MenuState.Play: case MenuState.Play:
@ -359,8 +360,11 @@ namespace osu.Game.Screens.Menu
if (impact) if (impact)
logo.Impact(); logo.Impact();
game.OverlayActivationMode.Value = OverlayActivation.All; if (game != null)
game.Toolbar.State = Visibility.Visible; {
game.OverlayActivationMode.Value = OverlayActivation.All;
game.Toolbar.State = Visibility.Visible;
}
}, 200); }, 200);
break; break;
default: default: