From ff0fd5a0d07021e5cf224a57659ebdf14a37cc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Merlin=20Z=C3=B6bl?= <41567572+K0369@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:53:58 +0200 Subject: [PATCH] fixing NRE of onLinkRemoved in landing showcase diagram --- site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs b/site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs index 4e571717..c78b7285 100644 --- a/site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs +++ b/site/Site/Components/Landing/LandingShowcaseDiagram.razor.cs @@ -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; } } \ No newline at end of file