Skip to content

Commit

Permalink
Fix: potential NRE on close
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaos66 committed Feb 9, 2023
1 parent 6396533 commit d43c7c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/Components/AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ public double GridSplitterHeight
new FrameworkPropertyMetadata((Style)null));

/// <summary>
/// Gets or sets the GridSplitterVerticalStyle property. This dependency property
/// Gets or sets the GridSplitterVerticalStyle property. This dependency property
/// indicates the style to apply to the LayoutGridResizerControl when displayed vertically.
/// </summary>
public Style GridSplitterVerticalStyle
Expand All @@ -1164,7 +1164,7 @@ public Style GridSplitterVerticalStyle
new FrameworkPropertyMetadata((Style)null));

/// <summary>
/// Gets or sets the GridSplitterHorizontalStyle property. This dependency property
/// Gets or sets the GridSplitterHorizontalStyle property. This dependency property
/// indicates the style to apply to the LayoutGridResizerControl when displayed horizontally.
/// </summary>
public Style GridSplitterHorizontalStyle
Expand Down Expand Up @@ -2292,7 +2292,7 @@ private void DocumentsSourceElementsChanged(object sender, NotifyCollectionChang
foreach (var documentToRemove in documentsToRemove)
{
documentToRemove.Content = null;
documentToRemove.Parent.RemoveChild(documentToRemove);
documentToRemove.Parent?.RemoveChild(documentToRemove);
RemoveViewFromLogicalChild(documentToRemove);
}
}
Expand Down Expand Up @@ -2354,7 +2354,7 @@ private void DocumentsSourceElementsChanged(object sender, NotifyCollectionChang
var documentsToRemove = GetItemsToRemoveAfterReset<LayoutDocument>(DocumentsSource);
foreach (var documentToRemove in documentsToRemove)
{
(documentToRemove.Parent as ILayoutContainer).RemoveChild(
(documentToRemove.Parent as ILayoutContainer)?.RemoveChild(
documentToRemove);
RemoveViewFromLogicalChild(documentToRemove);
}
Expand Down

0 comments on commit d43c7c6

Please sign in to comment.