浏览代码

Fixed crash moving mouuse in All Views Tester

Tig 1 年之前
父节点
当前提交
94749e428e
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Terminal.Gui/View/Adornment/Adornment.cs

+ 4 - 0
Terminal.Gui/View/Adornment/Adornment.cs

@@ -203,6 +203,10 @@ public class Adornment : View
     /// <returns><see langword="true"/> if the specified Parent's SuperView-relative coordinates are within the Adornment's Thickness. </returns>
     /// <returns><see langword="true"/> if the specified Parent's SuperView-relative coordinates are within the Adornment's Thickness. </returns>
     public override bool Contains (int x, int y)
     public override bool Contains (int x, int y)
     {
     {
+        if (Parent is null)
+        {
+            return false;
+        }
         Rectangle frame = Frame;
         Rectangle frame = Frame;
         frame.Offset (Parent.Frame.Location);
         frame.Offset (Parent.Frame.Location);