1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 10:03:21 +08:00

Merge pull request #8856 from peppy/fix-editor-hard-crash

Fix editor crashing when entering with no beatmap selected
This commit is contained in:
Dan Balasescu 2020-04-24 12:53:59 +09:00 committed by GitHub
commit 2a1335a21e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,9 +60,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
waveform.Waveform = b.NewValue.Waveform;
track = b.NewValue.Track;
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
Zoom = getZoomLevelForVisibleMilliseconds(2000);
if (track.Length > 0)
{
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
Zoom = getZoomLevelForVisibleMilliseconds(2000);
}
}, true);
}
@ -135,7 +138,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private void scrollToTrackTime()
{
if (!track.IsLoaded)
if (!track.IsLoaded || track.Length == 0)
return;
ScrollTo((float)(adjustableClock.CurrentTime / track.Length) * Content.DrawWidth, false);