Only switch to found group if non-null

This commit is contained in:
Dean Herbert 2022-06-01 20:20:16 +09:00
parent 187acb0718
commit 534e8f8fac

View File

@ -158,9 +158,12 @@ namespace osu.Game.Screens.Edit.Timing
// To improve the efficiency of this in the future, we should reconsider the overall structure of ControlPointInfo.
// Find the next group which has the same type as the selected one.
selectedGroup.Value = Beatmap.ControlPointInfo.Groups
.Where(g => g.ControlPoints.Any(cp => cp.GetType() == selectedPointType))
.LastOrDefault(g => g.Time <= clock.CurrentTimeAccurate);
var found = Beatmap.ControlPointInfo.Groups
.Where(g => g.ControlPoints.Any(cp => cp.GetType() == selectedPointType))
.LastOrDefault(g => g.Time <= clock.CurrentTimeAccurate);
if (found != null)
selectedGroup.Value = found;
}
}