浏览代码

Fixed null exception on tabbing. (#615)

BDisp 5 年之前
父节点
当前提交
05dd50afda
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Terminal.Gui/Core/Toplevel.cs

+ 8 - 0
Terminal.Gui/Core/Toplevel.cs

@@ -179,6 +179,10 @@ namespace Terminal.Gui {
 
 		IEnumerable<View> GetToplevelSubviews (bool isForward)
 		{
+			if (SuperView == null) {
+				return null;
+			}
+
 			HashSet<View> views = new HashSet<View> ();
 
 			foreach (var v in SuperView.Subviews) {
@@ -190,6 +194,10 @@ namespace Terminal.Gui {
 
 		void FocusNearestView (IEnumerable<View> views)
 		{
+			if (views == null) {
+				return;
+			}
+
 			bool found = false;
 
 			foreach (var v in views) {