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:
parent
2bc4bb9e20
commit
8b901fe60b
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user