瀏覽代碼

Prevent a crash if there are no views added to the Toplevel

miguel 6 年之前
父節點
當前提交
00c11ad70b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Terminal.Gui/Core.cs

+ 1 - 1
Terminal.Gui/Core.cs

@@ -907,7 +907,7 @@ namespace Terminal.Gui {
 		public void FocusFirst ()
 		{
 			if (subviews == null) {
-				SuperView.SetFocus (this);
+				SuperView?.SetFocus (this);
 				return;
 			}