From 0c76b97ef2f5c9a659c361ff7641e073e1ecefee Mon Sep 17 00:00:00 2001 From: Brandon Thetford Date: Wed, 21 Feb 2024 02:37:52 -0700 Subject: [PATCH] Enable null analysis here --- Terminal.Gui/Application.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Terminal.Gui/Application.cs b/Terminal.Gui/Application.cs index 67a103d6c..e6b2eec66 100644 --- a/Terminal.Gui/Application.cs +++ b/Terminal.Gui/Application.cs @@ -1170,12 +1170,13 @@ public static partial class Application return top; } + #nullable enable // Only return true if the Current has changed. private static bool MoveCurrent (Toplevel top) { // The Current is modal and the top is not modal Toplevel then // the Current must be moved above the first not modal Toplevel. - if (OverlappedTop != null + if (OverlappedTop is { } && top != OverlappedTop && top != Current && Current?.Modal == true @@ -1250,6 +1251,7 @@ public static partial class Application return true; } + #nullable restore /// Invoked when the terminal's size changed. The new size of the terminal is provided. ///