Not sure if this is the right place, but since it’s related to UIElements I thought it might be a good one.
I’m trying to write a custom node editor using the GraphView Experimental API, but I’m getting the following error when trying to drag create an edge from a port to another.
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.GraphView.EdgeDragHelper`1[TEdge].HandleMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at C:/buildslave/unity/build/Modules/GraphViewEditor/Manipulators/EdgeDragHelper.cs:324)
UnityEditor.Experimental.GraphView.EdgeConnector`1[TEdge].OnMouseUp (UnityEngine.UIElements.MouseUpEvent e) (at C:/buildslave/unity/build/Modules/GraphViewEditor/Manipulators/EdgeConnector.cs:114)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventCallback.cs:62)
UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventCallbackRegistry.cs:332)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventHandler.cs:80)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:84)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:189)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
It doesn’t even seem to call IEdgeConnectorListener’s OnDrop (in fact, it actually doesn’t call OnDropOutsidePort either for some reason, but without errors).
All nodes seem to have been correctly added to the GraphView (made the mistake of trying to use Add instead of AddElement on them before), so… I don’t know.