Browse Source

Prevent NRE in VisualNode.HitTest.

Not sure how this is happening but judging by #2758, it can happen. Defensively check for a null `Item` to prevent this.

Fixes #2758.
pull/2785/head
Steven Kirk 7 years ago
parent
commit
e82d67f664
  1. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs

2
src/Avalonia.Visuals/Rendering/SceneGraph/VisualNode.cs

@ -236,7 +236,7 @@ namespace Avalonia.Rendering.SceneGraph
{
foreach (var operation in DrawOperations)
{
if (operation.Item.HitTest(p))
if (operation?.Item?.HitTest(p) == true)
{
return true;
}

Loading…
Cancel
Save