Browse Source

Merge pull request #2785 from AvaloniaUI/fixes/2758-hittest-nullref

Prevent NRE in VisualNode.HitTest.
pull/2794/head
Nikita Tsukanov 7 years ago
committed by GitHub
parent
commit
fabd4cbe7e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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) foreach (var operation in DrawOperations)
{ {
if (operation.Item.HitTest(p)) if (operation?.Item?.HitTest(p) == true)
{ {
return true; return true;
} }

Loading…
Cancel
Save