From e2511344b8225817381db31af3c7e08f9a3ba4b0 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Thu, 25 May 2023 20:37:37 +0100 Subject: [PATCH] fix tests. --- src/Avalonia.Base/Input/PointerEventArgs.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Base/Input/PointerEventArgs.cs b/src/Avalonia.Base/Input/PointerEventArgs.cs index 383c807a73..9c24e5c314 100644 --- a/src/Avalonia.Base/Input/PointerEventArgs.cs +++ b/src/Avalonia.Base/Input/PointerEventArgs.cs @@ -72,7 +72,7 @@ namespace Avalonia.Input // If the visual the user passed in, is not connected to the same visual root // (i.e. they called it for a control inside a popup. - if (!ReferenceEquals(_rootVisual, relativeTo.VisualRoot)) + if (!ReferenceEquals(_rootVisual, relativeTo.VisualRoot) && relativeTo.VisualRoot is { }) { // Convert to absolute screen coordinates. var screenPt = _rootVisual.PointToScreen(pt);