1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 20:03:21 +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.
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -36,8 +37,10 @@ namespace osu.Game.Overlays
private AudioManager audio { get; set; }
[Resolved(canBeNull: true)]
[CanBeNull]
private FirstRunSetupOverlay firstRunSetup { get; set; }
[CanBeNull]
private IBindable<Visibility> firstRunSetupState;
[BackgroundDependencyLoader]
@ -103,8 +106,10 @@ namespace osu.Game.Overlays
State.ValueChanged += _ => updateProcessingMode();
firstRunSetupState = firstRunSetup.State.GetBoundCopy();
firstRunSetupState.ValueChanged += _ => updateProcessingMode();
firstRunSetupState = firstRunSetup?.State.GetBoundCopy();
if (firstRunSetupState != null)
firstRunSetupState.ValueChanged += _ => updateProcessingMode();
OverlayActivationMode.BindValueChanged(_ => updateProcessingMode(), true);
}