Fix possibly setting null track

This commit is contained in:
smoogipoo
2020-08-07 22:05:58 +09:00
parent 08820c62ec
commit b6fb7a0d39
3 changed files with 6 additions and 7 deletions

View File

@ -321,15 +321,13 @@ namespace osu.Game.Overlays
private void changeTrack()
{
CurrentTrack.Expire();
CurrentTrack = null;
CurrentTrack = new DrawableTrack(new TrackVirtual(1000));
if (current != null)
{
CurrentTrack = new DrawableTrack(current.GetRealTrack());
CurrentTrack.Completed += () => onTrackCompleted(current);
AddInternal(CurrentTrack);
}
CurrentTrack.Completed += () => onTrackCompleted(current);
AddInternal(CurrentTrack);
}
private void onTrackCompleted(WorkingBeatmap workingBeatmap)