From 2368ec87f1957d4046fb502e3723f3108cc7ebf3 Mon Sep 17 00:00:00 2001 From: BDisp Date: Sat, 29 Jul 2023 21:29:41 +0100 Subject: [PATCH] Prevents throw exception if Application.Current is null. --- Terminal.Gui/Core/View.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Terminal.Gui/Core/View.cs b/Terminal.Gui/Core/View.cs index d9e33548a..ed6439a8b 100644 --- a/Terminal.Gui/Core/View.cs +++ b/Terminal.Gui/Core/View.cs @@ -371,7 +371,7 @@ namespace Terminal.Gui { SuperView?.EnsureFocus (); if (SuperView != null && SuperView.Focused == null) { SuperView.FocusNext (); - if (SuperView.Focused == null) { + if (SuperView.Focused == null && Application.Current != null) { Application.Current.FocusNext (); } Application.EnsuresTopOnFront ();