1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 11:27:24 +08:00

Merge pull request #6986 from peppy/fix-test-link-nullref

Fix nullref on clicking links in tests
This commit is contained in:
Dan Balasescu 2019-11-28 20:43:21 +09:00 committed by GitHub
commit 5a322b7abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,14 +19,8 @@ namespace osu.Game.Graphics.Containers
{
}
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 @@ namespace osu.Game.Graphics.Containers
if (action != null)
action();
else
game.HandleLink(link);
game?.HandleLink(link);
},
});
}