Skip to content

Commit

Permalink
fixing NRE of onLinkRemoved in landing showcase diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
K0369 committed Oct 22, 2023
1 parent 93b154b commit ff0fd5a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ private void OnLinKTargetChanged(BaseLinkModel link, Anchor? oldTarget, Anchor?
private void OnLinkRemoved(BaseLinkModel link)
{
(link.Source.Model as PortModel)!.Parent.Refresh();
if (link.Target != null && link.Target.Model is PortModel portModel) portModel.Parent.Refresh();
if (link.Target is SinglePortAnchor anchor && anchor.Model is PortModel portModel)
{
portModel.Parent.Refresh();
}
link.TargetChanged -= OnLinKTargetChanged;
}
}

0 comments on commit ff0fd5a

Please sign in to comment.