mirror of
https://github.com/osukey/osukey.git
synced 2025-05-06 22:27:25 +09: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
|
protected class TestEditor : Editor
|
||||||
{
|
{
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
|
[CanBeNull]
|
||||||
private DialogOverlay dialogOverlay { get; set; }
|
private DialogOverlay dialogOverlay { get; set; }
|
||||||
|
|
||||||
public new void Undo() => base.Undo();
|
public new void Undo() => base.Undo();
|
||||||
@ -120,7 +121,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
public override bool OnExiting(IScreen next)
|
public override bool OnExiting(IScreen next)
|
||||||
{
|
{
|
||||||
// For testing purposes allow the screen to exit without saving on second attempt.
|
// 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>();
|
saveDialog.PerformAction<PopupDialogDangerousButton>();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user