AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.26k stars 2.19k forks source link

System.InvalidOperationException: Nullable object must have a value at Avalonia.Rendering.SceneGraph.Scene.HitTestEnumerator.FilterAndClip #10865

Closed cbrunin closed 1 year ago

cbrunin commented 1 year ago

Hi,

We have encountered the following exception with the following stack trace. Unfortunatly, we are not able to reproduce it. Maybe a guard could be set for this Nullable argument?

With Avalonia 0.10.17

CoreCLR Version: 6.0.1322.58009 .NET Version: 6.0.13 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException: Nullable object must have a value. at Avalonia.Rendering.SceneGraph.Scene.HitTestEnumerator.FilterAndClip(IVisualNode node, Nullable1& clip) in /_/src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs:line 310 at Avalonia.Rendering.SceneGraph.Scene.HitTestEnumerator.MoveNext() in /_/src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs:line 259 at Avalonia.Rendering.SceneGraph.Scene.HitTestFirst(IVisualNode root, Point p, Func2 filter) in //src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs:line 195 at Avalonia.Rendering.DeferredRenderer.HitTestFirst(Point p, IVisual root, Func`2 filter) in //src/Avalonia.Visuals/Rendering/DeferredRenderer.cs:line 186 at Avalonia.VisualTree.VisualExtensions.GetVisualAt(IVisual visual, Point p, Func2 filter) in /_/src/Avalonia.Visuals/VisualTree/VisualExtensions.cs:line 240 at Avalonia.Input.InputExtensions.InputHitTest(IInputElement element, Point p) in /_/src/Avalonia.Input/InputExtensions.cs:line 40 at Avalonia.Input.MouseDevice.SetPointerOver(IPointerDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers) in /_/src/Avalonia.Input/MouseDevice.cs:line 424 at Avalonia.Input.MouseDevice.MouseMove(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers, Lazy1 intermediatePoints) in //src/Avalonia.Input/MouseDevice.cs:line 273 at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e) in //src/Avalonia.Input/MouseDevice.cs:line 144 at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in //src/Avalonia.Input/InputManager.cs:line 37 at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in //src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs:line 518 at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in //src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs:line 33 at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg) at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in //src/Windows/Avalonia.Win32/Win32Platform.cs:line 210 at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in //src/Avalonia.Base/Threading/Dispatcher.cs:line 65 at Avalonia.Controls.DesktopApplicationExtensions.Run(Application app, CancellationToken token) in //src/Avalonia.Controls/DesktopApplicationExtensions.cs:line 57 at Nawan.Avalonia.Gui.Program.AppMain(Application app, String[] args) at Avalonia.Controls.AppBuilderBase`1.Start(AppMainDelegate main, String[] args) in /_/src/Avalonia.Controls/AppBuilderBase.cs:line 158 at Nawan.Avalonia.Gui.Program.Main(String[] args)

maxkatz6 commented 1 year ago

DeferredRenderer was completely removed from the framework in the 11.0 previews. This isn't an issue anymore, as bugged code does not exist anymore.

Whiletru3 commented 1 year ago

@maxkatz6 : As the 11.0 is still in preview, can it be fixed in Stable 0.10.x for an eventual 0.10.20 ?

maxkatz6 commented 1 year ago

@Whiletru3 unlikely. New renderer is a change by itself, which cannot be backported. And to manually fix - there is no resources for that.