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
1 changed files with 5 additions and 2 deletions

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 @@ public abstract class OsuScreen : Screen, IOsuScreen, IHasDescription
private OsuScreenDependencies screenDependencies;
private bool trackAdjustmentStateAtSuspend;
private bool? trackAdjustmentStateAtSuspend;
internal void CreateLeasedDependencies(IReadOnlyDependencyContainer dependencies) => createDependencies(dependencies);
@ -178,7 +179,9 @@ public override void OnResuming(IScreen last)
applyArrivingDefaults(true);
musicController.AllowTrackAdjustments = trackAdjustmentStateAtSuspend;
Debug.Assert(trackAdjustmentStateAtSuspend != null);
musicController.AllowTrackAdjustments = trackAdjustmentStateAtSuspend.Value;
base.OnResuming(last);
}