From d8f084474216cccb9add01ec3ec40f282bc42bce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 25 Dec 2017 11:24:13 +0900 Subject: [PATCH] Fix null reference in release builds Intro may not be initialised yet --- osu.Game/OsuGame.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 67f6e6f4e2..fe7ca77d44 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -272,7 +272,7 @@ namespace osu.Game }; } - Action stateChanged = delegate + void updateScreenOffset() { float offset = 0; @@ -281,11 +281,11 @@ namespace osu.Game if (notifications.State == Visibility.Visible) offset -= ToolbarButton.WIDTH / 2; - intro.MoveToX(offset, SettingsOverlay.TRANSITION_LENGTH, Easing.OutQuint); - }; + screenStack.MoveToX(offset, SettingsOverlay.TRANSITION_LENGTH, Easing.OutQuint); + } - settings.StateChanged += stateChanged; - notifications.StateChanged += stateChanged; + settings.StateChanged += _ => updateScreenOffset(); + notifications.StateChanged += _ => updateScreenOffset(); Cursor.State = Visibility.Hidden; }