1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-30 07:19:54 +08:00

Only switch to found group if non-null

This commit is contained in:
Dean Herbert
2022-06-01 20:20:16 +09:00
Unverified
parent 187acb0718
commit 534e8f8fac
+6 -3
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;
}
}