mirror of https://github.com/ppy/osu
Fix nullref on clicking links in tests
This commit is contained in:
parent
7e128cb1bb
commit
2865f32052
|
@ -19,14 +19,8 @@ public LinkFlowContainer(Action<SpriteText> 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<Link> links)
|
||||
{
|
||||
|
@ -82,7 +76,7 @@ private void createLink(IEnumerable<Drawable> drawables, LinkDetails link, strin
|
|||
if (action != null)
|
||||
action();
|
||||
else
|
||||
game.HandleLink(link);
|
||||
game?.HandleLink(link);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue