1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 12:02:54 +08:00

Ensure TakeFocus does not crash when not yet loaded

This commit is contained in:
Dean Herbert 2021-08-16 18:44:00 +09:00
parent 4b975ca10d
commit cecb312e77

View File

@ -22,7 +22,10 @@ namespace osu.Game.Graphics.UserInterface
public void TakeFocus()
{
if (allowImmediateFocus) GetContainingInputManager().ChangeFocus(this);
if (!allowImmediateFocus)
return;
Schedule(() => GetContainingInputManager().ChangeFocus(this));
}
public bool HoldFocus