浏览代码

Make logic more robust

Ross Ferguson 5 年之前
父节点
当前提交
0ab562a0fd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Terminal.Gui/Views/ComboBox.cs

+ 1 - 1
Terminal.Gui/Views/ComboBox.cs

@@ -144,7 +144,7 @@ namespace Terminal.Gui {
 
 				// Determine if this view is hosted inside a dialog and is the only control
 				for (View view = this.SuperView; view != null; view = view.SuperView) {
-					if (view is Dialog && view.Subviews.Count == 1 && view.Subviews [0].Subviews.Count == 1) {
+					if (view is Dialog && SuperView != null && SuperView.Subviews.Count == 1 && SuperView.Subviews[0] == this) {
 						autoHide = false;
 						break;
 					}