Преглед изворни кода

SuperView is not always a TopLevel - causing a cast exception

Charlie Kindel пре 5 година
родитељ
комит
d26b9bdfe9
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      Terminal.Gui/Core.cs

+ 1 - 1
Terminal.Gui/Core.cs

@@ -1649,7 +1649,7 @@ namespace Terminal.Gui {
 				m = ((Toplevel)SuperView).HasMenuBar;
 				m = ((Toplevel)SuperView).HasMenuBar;
 			int l = m ? 1 : 0;
 			int l = m ? 1 : 0;
 			ny = Math.Max (y, l);
 			ny = Math.Max (y, l);
-			if (SuperView == null)
+			if (SuperView == null || SuperView.GetType() != typeof(Toplevel))
 				s = Application.Top.HasStatusBar;
 				s = Application.Top.HasStatusBar;
 			else
 			else
 				s = ((Toplevel)SuperView).HasStatusBar;
 				s = ((Toplevel)SuperView).HasStatusBar;