Closed emrys90 closed 3 years ago
I figured out the issue for this. CreatePushDataDelegateForEdge in NodePort does reflection for public fields only, while my fields were private with a SerializeField attribute. I added BindingFlags.NonPublic to the flags and I no longer get this error.
Hello, thanks for investigating this issue, this should be fixed with https://github.com/alelievr/NodeGraphProcessor/commit/8e93c04143d4c5a793a07357a0f10782b658eabc
Anytime scripts recompile or I enter play mode, I get this exception:
System.NullReferenceException: Object reference not set to an instance of an object at GraphProcessor.NodePort.CreatePushDataDelegateForEdge (GraphProcessor.SerializableEdge edge) [0x00034] in C:\Projects\Tests\NodeGraphProcessorTest\Packages\com.alelievr.NodeGraphProcessor\Runtime\Elements\NodePort.cs:191 UnityEngine.Debug:LogError(Object) GraphProcessor.NodePort:CreatePushDataDelegateForEdge(SerializableEdge) (at Packages/com.alelievr.NodeGraphProcessor/Runtime/Elements/NodePort.cs:220) GraphProcessor.NodePort:Add(SerializableEdge) (at Packages/com.alelievr.NodeGraphProcessor/Runtime/Elements/NodePort.cs:155) GraphProcessor.NodePortContainer:Add(SerializableEdge) (at Packages/com.alelievr.NodeGraphProcessor/Runtime/Elements/NodePort.cs:356) GraphProcessor.BaseNode:OnEdgeConnected(SerializableEdge) (at Packages/com.alelievr.NodeGraphProcessor/Runtime/Elements/BaseNode.cs:536) GraphProcessor.BaseGraph:Deserialize() (at Packages/com.alelievr.NodeGraphProcessor/Runtime/Graph/BaseGraph.cs:456) GraphProcessor.BaseGraph:OnEnable() (at Packages/com.alelievr.NodeGraphProcessor/Runtime/Graph/BaseGraph.cs:168)
Any ideas how to resolve this? Am I doing something wrong?