Ensure CurrentTrack is never null

This commit is contained in:
smoogipoo
2020-08-07 19:43:16 +09:00
parent bf21fdd6da
commit 61b632516e
10 changed files with 8 additions and 22 deletions

View File

@ -109,14 +109,14 @@ namespace osu.Game.Screens.Menu
private void updateAmplitudes()
{
var effect = beatmap.Value.BeatmapLoaded && musicController.TrackLoaded
? beatmap.Value.Beatmap?.ControlPointInfo.EffectPointAt(musicController.CurrentTrack.AsNonNull().CurrentTime)
? beatmap.Value.Beatmap?.ControlPointInfo.EffectPointAt(musicController.CurrentTrack.CurrentTime)
: null;
for (int i = 0; i < temporalAmplitudes.Length; i++)
temporalAmplitudes[i] = 0;
if (musicController.TrackLoaded)
addAmplitudesFromSource(musicController.CurrentTrack.AsNonNull());
addAmplitudesFromSource(musicController.CurrentTrack);
foreach (var source in amplitudeSources)
addAmplitudesFromSource(source);

View File

@ -179,8 +179,6 @@ namespace osu.Game.Screens.Menu
if (last is IntroScreen && music.TrackLoaded)
{
Debug.Assert(music.CurrentTrack != null);
if (!music.CurrentTrack.IsRunning)
{
music.CurrentTrack.Seek(metadata.PreviewTime != -1 ? metadata.PreviewTime : 0.4f * music.CurrentTrack.Length);