From 6541b1e35d8a0958b4a7f40d8973d95583e95eee Mon Sep 17 00:00:00 2001 From: Noisrev Date: Sat, 24 Dec 2022 21:33:07 +0800 Subject: [PATCH] Add null check for BringWindowToTop2 --- source/Components/AvalonDock/Controls/DragService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Components/AvalonDock/Controls/DragService.cs b/source/Components/AvalonDock/Controls/DragService.cs index e01d5f96..96e6c641 100644 --- a/source/Components/AvalonDock/Controls/DragService.cs +++ b/source/Components/AvalonDock/Controls/DragService.cs @@ -279,6 +279,8 @@ internal void Abort() private void BringWindowToTop2(Window window) { + if (window == null) return; + Win32Helper.SetWindowPos(new WindowInteropHelper(window).Handle, IntPtr.Zero, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreResize | Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.DoNotActivate); }