瀏覽代碼

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>
     public override bool Contains (int x, int y)
     {
+        if (Parent is null)
+        {
+            return false;
+        }
         Rectangle frame = Frame;
         frame.Offset (Parent.Frame.Location);