diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 61391b7102..2bbac92f7f 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -19,14 +19,8 @@ public LinkFlowContainer(Action defaultCreationParameters = null) { } - private OsuGame game; - - [BackgroundDependencyLoader(true)] - private void load(OsuGame game) - { - // will be null in tests - this.game = game; - } + [Resolved(CanBeNull = true)] + private OsuGame game { get; set; } public void AddLinks(string text, List links) { @@ -82,7 +76,7 @@ private void createLink(IEnumerable drawables, LinkDetails link, strin if (action != null) action(); else - game.HandleLink(link); + game?.HandleLink(link); }, }); }