Make logic more robust

This commit is contained in:
Ross Ferguson
2020-07-22 16:40:26 +01:00
committed by BDisp
parent a28417a980
commit 8d507040f0

View File

@@ -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;
}