From 05dd50afda8c232e39a55b32f9c3dcd810fd1a7f Mon Sep 17 00:00:00 2001 From: BDisp Date: Thu, 4 Jun 2020 18:48:46 +0100 Subject: [PATCH] Fixed null exception on tabbing. (#615) --- Terminal.Gui/Core/Toplevel.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Terminal.Gui/Core/Toplevel.cs b/Terminal.Gui/Core/Toplevel.cs index 9c85c2681..34aeb4bcd 100644 --- a/Terminal.Gui/Core/Toplevel.cs +++ b/Terminal.Gui/Core/Toplevel.cs @@ -179,6 +179,10 @@ namespace Terminal.Gui { IEnumerable GetToplevelSubviews (bool isForward) { + if (SuperView == null) { + return null; + } + HashSet views = new HashSet (); foreach (var v in SuperView.Subviews) { @@ -190,6 +194,10 @@ namespace Terminal.Gui { void FocusNearestView (IEnumerable views) { + if (views == null) { + return; + } + bool found = false; foreach (var v in views) {