mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Merge pull request #6986 from peppy/fix-test-link-nullref
Fix nullref on clicking links in tests
This commit is contained in:
commit
5a322b7abb
@ -19,14 +19,8 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private OsuGame game;
|
[Resolved(CanBeNull = true)]
|
||||||
|
private OsuGame game { get; set; }
|
||||||
[BackgroundDependencyLoader(true)]
|
|
||||||
private void load(OsuGame game)
|
|
||||||
{
|
|
||||||
// will be null in tests
|
|
||||||
this.game = game;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddLinks(string text, List<Link> links)
|
public void AddLinks(string text, List<Link> links)
|
||||||
{
|
{
|
||||||
@ -82,7 +76,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
if (action != null)
|
if (action != null)
|
||||||
action();
|
action();
|
||||||
else
|
else
|
||||||
game.HandleLink(link);
|
game?.HandleLink(link);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user