mirror of
https://github.com/ppy/osu
synced 2025-02-28 08:31:18 +00:00
Fix potential null due to async load
This commit is contained in:
parent
ec88f7a712
commit
6546fd3f81
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
LoadScreen(loader);
|
LoadScreen(loader);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("spinner did not display", () => loader.LoadingSpinner.Alpha == 0);
|
AddAssert("spinner did not display", () => loader.LoadingSpinner?.Alpha == 0);
|
||||||
|
|
||||||
AddUntilStep("loaded", () => loader.ScreenLoaded);
|
AddUntilStep("loaded", () => loader.ScreenLoaded);
|
||||||
AddUntilStep("not current", () => !loader.IsCurrentScreen());
|
AddUntilStep("not current", () => !loader.IsCurrentScreen());
|
||||||
@ -67,7 +67,7 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
{
|
{
|
||||||
public readonly ManualResetEventSlim AllowLoad = new ManualResetEventSlim();
|
public readonly ManualResetEventSlim AllowLoad = new ManualResetEventSlim();
|
||||||
|
|
||||||
public LoadingSpinner LoadingSpinner => this.ChildrenOfType<LoadingSpinner>().Single();
|
public LoadingSpinner LoadingSpinner => this.ChildrenOfType<LoadingSpinner>().FirstOrDefault();
|
||||||
private TestScreen screen;
|
private TestScreen screen;
|
||||||
|
|
||||||
public bool ScreenLoaded => screen.IsCurrentScreen();
|
public bool ScreenLoaded => screen.IsCurrentScreen();
|
||||||
|
Loading…
Reference in New Issue
Block a user