Explorar o código

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

miguel %!s(int64=7) %!d(string=hai) anos
pai
achega
00c11ad70b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;
 			}