1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 14:12:54 +08:00

Fix potential null reference

This commit is contained in:
Salman Ahmed 2022-06-15 18:53:49 +03:00
parent 387c54c252
commit e7dcbddbeb

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Linq; using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -36,8 +37,10 @@ namespace osu.Game.Overlays
private AudioManager audio { get; set; } private AudioManager audio { get; set; }
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
[CanBeNull]
private FirstRunSetupOverlay firstRunSetup { get; set; } private FirstRunSetupOverlay firstRunSetup { get; set; }
[CanBeNull]
private IBindable<Visibility> firstRunSetupState; private IBindable<Visibility> firstRunSetupState;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -103,8 +106,10 @@ namespace osu.Game.Overlays
State.ValueChanged += _ => updateProcessingMode(); State.ValueChanged += _ => updateProcessingMode();
firstRunSetupState = firstRunSetup.State.GetBoundCopy(); firstRunSetupState = firstRunSetup?.State.GetBoundCopy();
firstRunSetupState.ValueChanged += _ => updateProcessingMode();
if (firstRunSetupState != null)
firstRunSetupState.ValueChanged += _ => updateProcessingMode();
OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true); OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
} }