瀏覽代碼

Prevents throw exception if Application.Current is null.

BDisp 2 年之前
父節點
當前提交
2368ec87f1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Terminal.Gui/Core/View.cs

+ 1 - 1
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 ();