mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:02:55 +08:00
Fix calling SkinEditorOverlay.Show
before the overlay is loaded causing an exception
As seen at https://github.com/ppy/osu/runs/4652969942?check_suite_focus=true.
This commit is contained in:
parent
f78adbea36
commit
471eea750a
@ -73,9 +73,13 @@ namespace osu.Game.Skinning.Editor
|
||||
skinEditor = new SkinEditor(target);
|
||||
skinEditor.State.BindValueChanged(editorVisibilityChanged);
|
||||
|
||||
Debug.Assert(skinEditor != null);
|
||||
|
||||
LoadComponentAsync(skinEditor, AddInternal);
|
||||
// Schedule ensures that if `Show` is called before this overlay is loaded,
|
||||
// it will not throw (LoadComponentAsync requires the load target to be in a loaded state).
|
||||
Schedule(() =>
|
||||
{
|
||||
Debug.Assert(skinEditor != null);
|
||||
LoadComponentAsync(skinEditor, AddInternal);
|
||||
});
|
||||
}
|
||||
else
|
||||
skinEditor.Show();
|
||||
|
Loading…
Reference in New Issue
Block a user