I believe that sample is assuming there is only one part that is selected. For your purposes the code needs to iterate over the Diagram.selection collection, finding and modifying a named Shape inside each Part.
So you are saying that the value of Panel.findObject(“shape”), called on the Node, is returning null? I cannot explain that. I don’t understand why you are talking about linking two nodes.
Is the problem that the selected Part is a Link, not a Node? If so, you just need to make sure that the main link Shape is named “shape” too.
this is for my school project. When you click on the plus sign after selecting a node, it all goes as expected. When you double click to create a new node and link those 2 I get that error as stated before. My gojs templating code can be found here: http://scripttesting.com/mindmapping/assets/js/diagram/diagram.js