diff --git a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs b/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs index d85895fc..045d508c 100644 --- a/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs +++ b/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs @@ -318,7 +318,7 @@ namespace Ryujinx.Ava.UI.Helpers Window parent = GetMainWindow(); - if (parent is { IsActive: true } and MainWindow window && window.ViewModel.IsGameRunning) + if (parent != null && parent.IsActive && (parent as MainWindow).ViewModel.IsGameRunning) { contentDialogOverlayWindow = new() { diff --git a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs index cf84807e..66988c4b 100644 --- a/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx.Ava/UI/Windows/MainWindow.axaml.cs @@ -519,14 +519,14 @@ namespace Ryujinx.Ava.UI.Windows private void ConfirmExit() { Dispatcher.UIThread.InvokeAsync(async () => - { - ViewModel.IsClosing = await ContentDialogHelper.CreateExitDialog(); + { + ViewModel.IsClosing = await ContentDialogHelper.CreateExitDialog(); - if (ViewModel.IsClosing) - { - Close(); - } - }); + if (ViewModel.IsClosing) + { + Close(); + } + }); } public async void LoadApplications()