1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 20:22:55 +08:00

Make suspend stored state nullable to ensure we don't break it

This commit is contained in:
Dean Herbert 2021-09-16 16:12:14 +09:00
parent fa693bb8a8
commit b58415fe19

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -94,7 +95,7 @@ namespace osu.Game.Screens
private OsuScreenDependencies screenDependencies;
private bool trackAdjustmentStateAtSuspend;
private bool? trackAdjustmentStateAtSuspend;
internal void CreateLeasedDependencies(IReadOnlyDependencyContainer dependencies) => createDependencies(dependencies);
@ -178,7 +179,9 @@ namespace osu.Game.Screens
applyArrivingDefaults(true);
musicController.AllowTrackAdjustments = trackAdjustmentStateAtSuspend;
Debug.Assert(trackAdjustmentStateAtSuspend != null);
musicController.AllowTrackAdjustments = trackAdjustmentStateAtSuspend.Value;
base.OnResuming(last);
}