aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2023-06-03 05:37:00 +0200
committerGitHub <noreply@github.com>2023-06-03 03:37:00 +0000
commitc545c598512f57de2d178f78095f8bc7b31f07c3 (patch)
tree4297a36b4e0274f7f16c69e3c5b588f945190964 /src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs
parent96ea4e8c8e38f42073c1f8d7fb66c89a663e95e0 (diff)
ava: Fix exit dialog while guest is running. (#5207)1.1.856
* ava: Fix exit dialog while guest is running. There is currently an issue while a game runs, the content dialog creation method check if `IsGameRunning` is true to show the popup. But the condition here is wrong (`window` is null) so it throw a NullException silently in `Dispatcher.UIThread`. This is now fixed by using the right casting. * improve condition * Fix spacing
Diffstat (limited to 'src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs')
-rw-r--r--src/Ryujinx.Ava/UI/Helpers/ContentDialogHelper.cs2
1 files changed, 1 insertions, 1 deletions
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()
{