diff --git a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs index 521d9650d9..666d0e3f77 100644 --- a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs +++ b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs @@ -11,7 +11,8 @@ namespace osu.Game.Graphics.Containers { public class BeatSyncedContainer : Container { - private Bindable beatmap; + private Bindable beatmap = new Bindable(); + private int lastBeat; private double lastTimingPointStart; //This is to avoid sending new beats when not at the very start of the beat @@ -20,7 +21,7 @@ public class BeatSyncedContainer : Container protected override void Update() { - if (beatmap.Value == null) + if (beatmap.Value?.Track == null) return; double trackCurrentTime = beatmap.Value.Track.CurrentTime; @@ -53,7 +54,7 @@ protected virtual void OnNewBeat(int newBeat, double beatLength, TimeSignatures [BackgroundDependencyLoader] private void load(OsuGameBase game) { - beatmap = game.Beatmap; + beatmap.BindTo(game.Beatmap); } } }