diff --git a/osu.Game.Tests/Visual/Settings/TestSceneLatencyCertifierScreen.cs b/osu.Game.Tests/Visual/Settings/TestSceneLatencyCertifierScreen.cs index 687d7c490c..6d8c6d3c54 100644 --- a/osu.Game.Tests/Visual/Settings/TestSceneLatencyCertifierScreen.cs +++ b/osu.Game.Tests/Visual/Settings/TestSceneLatencyCertifierScreen.cs @@ -19,7 +19,9 @@ public class TestSceneLatencyCertifierScreen : ScreenTestScene public override void SetUpSteps() { base.SetUpSteps(); + AddStep("Load screen", () => LoadScreen(latencyCertifier = new LatencyCertifierScreen())); + AddUntilStep("wait for load", () => latencyCertifier.IsLoaded); } [Test] @@ -33,7 +35,6 @@ public void TestCertification() } AddAssert("check at results", () => !latencyCertifier.ChildrenOfType().Any()); - AddAssert("check no buttons", () => !latencyCertifier.ChildrenOfType().Any()); } diff --git a/osu.Game/Screens/Utility/LatencyCertifierScreen.cs b/osu.Game/Screens/Utility/LatencyCertifierScreen.cs index 157998184c..568e477d8f 100644 --- a/osu.Game/Screens/Utility/LatencyCertifierScreen.cs +++ b/osu.Game/Screens/Utility/LatencyCertifierScreen.cs @@ -190,7 +190,7 @@ private void showResults() { mainArea.Clear(); - var displayMode = host.Window.CurrentDisplayMode.Value; + var displayMode = host.Window?.CurrentDisplayMode.Value; string exclusive = "unknown"; @@ -217,7 +217,7 @@ private void showResults() statusText.AddParagraph(string.Empty); } - statusText.AddParagraph($"Polling: {pollingMax} hz Monitor: {displayMode.RefreshRate:N0} hz Exclusive: {exclusive}", cp => cp.Font = OsuFont.Default.With(size: 15)); + statusText.AddParagraph($"Polling: {pollingMax} hz Monitor: {displayMode?.RefreshRate ?? 0:N0} hz Exclusive: {exclusive}", cp => cp.Font = OsuFont.Default.With(size: 15)); statusText.AddParagraph($"Input: {host.InputThread.Clock.FramesPerSecond} hz " + $"Update: {host.UpdateThread.Clock.FramesPerSecond} hz "