From 981370f2159fe33b2ba99c237b9f9f74f9269841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=99=93=E9=9D=92?= <569132102@qq.com> Date: Fri, 3 Jul 2020 13:43:57 +0800 Subject: [PATCH] .. --- .../Components/AvalonDock/Controls/LayoutDocumentPaneControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Components/AvalonDock/Controls/LayoutDocumentPaneControl.cs b/source/Components/AvalonDock/Controls/LayoutDocumentPaneControl.cs index 53944d2d..da2c900f 100644 --- a/source/Components/AvalonDock/Controls/LayoutDocumentPaneControl.cs +++ b/source/Components/AvalonDock/Controls/LayoutDocumentPaneControl.cs @@ -96,7 +96,7 @@ protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) { foreach (var item in e.OldItems) { - if (item is LayoutContent layoutContent) + if (item is LayoutContent layoutContent && layoutContent.TabItem != null) { layoutContent.TabItem.Model = null; layoutContent.TabItem.ContextMenu = null;