mirror of
https://github.com/ppy/osu
synced 2025-01-11 00:29:30 +00:00
Fix unprotected access to potentially-null DI'd dialog overlay
This commit is contained in:
parent
f3aad77239
commit
51a1721bc9
@ -97,6 +97,7 @@ namespace osu.Game.Tests.Visual
|
||||
protected class TestEditor : Editor
|
||||
{
|
||||
[Resolved(canBeNull: true)]
|
||||
[CanBeNull]
|
||||
private DialogOverlay dialogOverlay { get; set; }
|
||||
|
||||
public new void Undo() => base.Undo();
|
||||
@ -120,7 +121,7 @@ namespace osu.Game.Tests.Visual
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
// For testing purposes allow the screen to exit without saving on second attempt.
|
||||
if (!ExitConfirmed && dialogOverlay.CurrentDialog is PromptForSaveDialog saveDialog)
|
||||
if (!ExitConfirmed && dialogOverlay?.CurrentDialog is PromptForSaveDialog saveDialog)
|
||||
{
|
||||
saveDialog.PerformAction<PopupDialogDangerousButton>();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user