1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00

Fix potential null reference when running recursive findValidTarget

This commit is contained in:
Dean Herbert 2022-04-14 16:22:40 +09:00
parent 2bc4bb9e20
commit 8b901fe60b

View File

@ -97,11 +97,14 @@ namespace osu.Game
// if this has a sub stack, recursively check the screens within it.
if (current is IHasSubScreenStack currentSubScreen)
{
if (findValidTarget(currentSubScreen.SubScreenStack.CurrentScreen))
var nestedCurrent = currentSubScreen.SubScreenStack.CurrentScreen;
if (nestedCurrent != null)
{
// should be correct in theory, but currently untested/unused in existing implementations.
current.MakeCurrent();
return true;
// note that calling findValidTarget actually performs the final operation.
if (findValidTarget(nestedCurrent))
return true;
}
}