mirror of
https://github.com/ppy/osu.git
synced 2026-05-26 08:50:00 +08:00
Fix potential null reference with flash sample when exiting rapidly
Fixes `TestForceExitWithOperationInProgress()`.
This commit is contained in:
@@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
private readonly Vector2 ringMinifiedSize = new Vector2(20f);
|
||||
|
||||
private readonly Box flashLayer;
|
||||
private Sample flashSample = null!;
|
||||
private Sample? flashSample;
|
||||
|
||||
private readonly Container content;
|
||||
private readonly Container ring;
|
||||
@@ -267,7 +267,7 @@ namespace osu.Game.Overlays.Dialog
|
||||
flashLayer.FadeInFromZero(80, Easing.OutQuint)
|
||||
.Then()
|
||||
.FadeOutFromOne(1500, Easing.OutQuint);
|
||||
flashSample.Play();
|
||||
flashSample?.Play();
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
|
||||
Reference in New Issue
Block a user