1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:13:21 +08:00

Revert to old behaviour if no TrackManager available

This commit is contained in:
Shane Woolcock 2019-01-08 18:35:23 +10:30
parent 4bfc7b4384
commit d74aa52e69

View File

@ -28,7 +28,7 @@ namespace osu.Game.Beatmaps
{ {
this.store = store; this.store = store;
this.audioManager = audioManager; this.audioManager = audioManager;
this.trackManager = audioManager.Track; trackManager = audioManager?.Track;
} }
protected override IBeatmap GetBeatmap() protected override IBeatmap GetBeatmap()
@ -70,7 +70,7 @@ namespace osu.Game.Beatmaps
try try
{ {
var trackData = store.GetStream(getPathForFile(Metadata.AudioFile)); var trackData = store.GetStream(getPathForFile(Metadata.AudioFile));
return trackData == null ? null : trackManager.CreateTrack(trackData); return trackData == null ? null : trackManager?.CreateTrack(trackData) ?? new TrackBass(trackData);
} }
catch catch
{ {
@ -91,7 +91,7 @@ namespace osu.Game.Beatmaps
try try
{ {
var trackData = store.GetStream(getPathForFile(Metadata.AudioFile)); var trackData = store.GetStream(getPathForFile(Metadata.AudioFile));
return trackData == null ? null : trackManager.CreateWaveform(trackData); return trackData == null ? null : trackManager?.CreateWaveform(trackData) ?? new Waveform(trackData);
} }
catch catch
{ {