Fix toolbar ruleset selector potentially null-refing (#5438)

Fix toolbar ruleset selector potentially null-refing
This commit is contained in:
Dean Herbert
2019-07-23 16:10:06 +09:00
committed by GitHub

View File

@ -71,8 +71,11 @@ namespace osu.Game.Overlays.Toolbar
// Scheduled to allow the flow layout to be computed before the line position is updated
private void moveLineToCurrent() => ScheduleAfterChildren(() =>
{
ModeButtonLine.MoveToX(SelectedTab.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint);
hasInitialPosition = true;
if (SelectedTab != null)
{
ModeButtonLine.MoveToX(SelectedTab.DrawPosition.X, !hasInitialPosition ? 0 : 200, Easing.OutQuint);
hasInitialPosition = true;
}
});
public override bool HandleNonPositionalInput => !Current.Disabled && base.HandleNonPositionalInput;