From 796223d3e0e3f62c640a7c4a64046c781b257d87 Mon Sep 17 00:00:00 2001
From: mcendu <nathandu@outlook.com>
Date: Sun, 22 Dec 2019 21:39:25 +0800
Subject: [PATCH] Invert if

---
 osu.Game/Screens/Menu/MainMenu.cs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs
index ee4d98bd89..b28d572b5c 100644
--- a/osu.Game/Screens/Menu/MainMenu.cs
+++ b/osu.Game/Screens/Menu/MainMenu.cs
@@ -249,14 +249,16 @@ namespace osu.Game.Screens.Menu
         {
             if (!exitConfirmed && dialogOverlay != null)
             {
-                if (!(dialogOverlay.CurrentDialog is ConfirmExitDialog))
+                if (dialogOverlay.CurrentDialog is ConfirmExitDialog exitDialog)
+                {
+                    exitConfirmed = true;
+                    exitDialog.Buttons.First().Click();
+                }
+                else
                 {
                     dialogOverlay.Push(new ConfirmExitDialog(confirmAndExit, () => exitConfirmOverlay.Abort()));
                     return true;
                 }
-
-                exitConfirmed = true;
-                dialogOverlay.CurrentDialog.Buttons.First().Click();
             }
 
             buttons.State = ButtonSystemState.Exit;