Allow loginOverlay to be null if there's no cached instance in DI (for testing cases)

This commit is contained in:
Lucas A
2019-04-06 18:52:30 +02:00
parent 394f14965b
commit 3f2e6a9376

View File

@ -103,7 +103,7 @@ namespace osu.Game.Screens.Menu
[Resolved(CanBeNull = true)] [Resolved(CanBeNull = true)]
private NotificationOverlay notifications { get; set; } private NotificationOverlay notifications { get; set; }
[Resolved] [Resolved(CanBeNull = true)]
private LoginOverlay loginOverlay { get; set; } private LoginOverlay loginOverlay { get; set; }
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
@ -141,7 +141,7 @@ namespace osu.Game.Screens.Menu
Icon = FontAwesome.Solid.Globe, Icon = FontAwesome.Solid.Globe,
Activated = () => Activated = () =>
{ {
loginOverlay.Show(); loginOverlay?.Show();
return true; return true;
} }
}); });