1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Fix WaveformComparisonDisplay potentially crashing on invalid track length

As seen at https://github.com/ppy/osu/runs/17415814918#r0s2.
This commit is contained in:
Dean Herbert 2023-10-05 14:58:50 +09:00
parent 66824ce8ca
commit 76cc2f9f22
No known key found for this signature in database

View File

@ -191,6 +191,10 @@ namespace osu.Game.Screens.Edit.Timing
private void regenerateDisplay(bool animated)
{
// Before a track is loaded, it won't have a valid length, which will break things.
if (!beatmap.Value.Track.IsLoaded)
return;
double index = (displayedTime - selectedGroupStartTime) / timingPoint.BeatLength;
// Chosen as a pretty usable number across all BPMs.