From 06bfd0da9dc8e952a168d0efee8cf17b781b97fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miha=20Marki=C4=8D?= Date: Mon, 11 Jun 2018 09:22:53 +0200 Subject: [PATCH] Fixes cases where subviews can be null --- Terminal.Gui/Core.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Terminal.Gui/Core.cs b/Terminal.Gui/Core.cs index 919e2934a..9a9c65fb4 100644 --- a/Terminal.Gui/Core.cs +++ b/Terminal.Gui/Core.cs @@ -281,7 +281,7 @@ namespace Terminal.Gui { /// The enumerator. public IEnumerator GetEnumerator () { - foreach (var v in subviews) + foreach (var v in Subviews) yield return v; } @@ -512,7 +512,7 @@ namespace Terminal.Gui { /// public virtual void Remove (View view) { - if (view == null) + if (view == null || subviews == null) return; SetNeedsDisplay ();