From 84a52b85d4029f7014f3255036c3b0fa23c05edf Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 1 Feb 2022 17:22:25 +0100 Subject: [PATCH] NullCheck for currentActiveContent currentActiveContent can be null and will throw an exception --- source/Components/AvalonDock/Controls/DropTarget.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Components/AvalonDock/Controls/DropTarget.cs b/source/Components/AvalonDock/Controls/DropTarget.cs index c1c31ca3..9694c39d 100644 --- a/source/Components/AvalonDock/Controls/DropTarget.cs +++ b/source/Components/AvalonDock/Controls/DropTarget.cs @@ -121,7 +121,8 @@ public void Drop(LayoutFloatingWindow floatingWindow) var fwAsDocument = floatingWindow as LayoutDocumentFloatingWindow; this.Drop(fwAsDocument); } - + if (currentActiveContent == null) + return; Dispatcher.BeginInvoke(new Action(() => { currentActiveContent.IsSelected = false; @@ -149,4 +150,4 @@ public void DragLeave() #endregion Public Methods } -} \ No newline at end of file +}