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

Avoid accessing beatmaps from BeatSyncedContainer until they are loaded

This commit is contained in:
Dean Herbert 2017-11-17 18:36:24 +09:00
parent d75e3d8e81
commit b3aae2340b

View File

@ -35,9 +35,12 @@ namespace osu.Game.Graphics.Containers
protected override void Update()
{
var track = Beatmap.Value.Track;
if (!Beatmap.Value.TrackLoaded || !Beatmap.Value.BeatmapLoaded) return;
if (track == null)
var track = Beatmap.Value.Track;
var beatmap = Beatmap.Value.Beatmap;
if (track == null || beatmap == null)
return;
double currentTrackTime = track.Length > 0 ? track.CurrentTime + EarlyActivationMilliseconds : Clock.CurrentTime;