in Microsoft.AspNetCore.SignalR.ClientProxyExtensions.
Here is my code:
Point newPosition = new Point(Position.X, Position.Y + 50);
SimpleTaskNode node = _parent.CreateNewNodeOnPosition(newPosition);
foreach (LinkModel linkModel in _parent.Diagram.Links)
{
var sourceNode = (linkModel.Source as SinglePortAnchor)!.Port.Parent;
var targetNode = (linkModel.Target as SinglePortAnchor)!.Port.Parent;
if (sourceNode == this)
{
LinkModel link = new LinkModel(node.GetPort(PortAlignment.Right), targetNode.GetPort(PortAlignment.Left));
_parent.Diagram.Links.Add(link);
}
if (targetNode == this)
{
LinkModel link = new LinkModel(sourceNode.GetPort(PortAlignment.Right), node.GetPort(PortAlignment.Left));
_parent.Diagram.Links.Add(link);
}
}
When I try to copy a node I get a System.NullReferenceException: "Object reference not set to an instance of an object." from
in Microsoft.AspNetCore.SignalR.ClientProxyExtensions.
Here is my code:
The exception is thrown when I add a link.