mirror of
https://github.com/ppy/osu
synced 2025-03-02 09:30:57 +00:00
Avoid potential crash if an overlay is toggled before it has been loaded
This commit is contained in:
parent
711d895a04
commit
a9c4fa442a
@ -756,6 +756,10 @@ namespace osu.Game
|
||||
|
||||
private void showOverlayAboveOthers(OverlayContainer overlay, OverlayContainer[] otherOverlays)
|
||||
{
|
||||
// generally shouldn't ever hit this state, but protects against a crash on attempting to change ChildDepth.
|
||||
if (overlay.LoadState < LoadState.Ready)
|
||||
return;
|
||||
|
||||
otherOverlays.Where(o => o != overlay).ForEach(o => o.Hide());
|
||||
|
||||
// show above others if not visible at all, else leave at current depth.
|
||||
|
Loading…
Reference in New Issue
Block a user