Skip to content

Commit ed1ffe7

Browse files
committed
Fixed a nullref on undo parameters when graph is closed
1 parent 09d48c9 commit ed1ffe7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Assets/com.alelievr.NodeGraphProcessor/Editor/Views/ExposedParameterView.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ protected override void Initialize(BaseGraphView graphView)
103103
RegisterCallback<DragUpdatedEvent>(OnDragUpdatedEvent);
104104
RegisterCallback<DragPerformEvent>(OnDragPerformEvent);
105105
RegisterCallback<MouseDownEvent>(OnMouseDownEvent, TrickleDown.TrickleDown);
106+
RegisterCallback<DetachFromPanelEvent>(OnViewClosed);
106107

107108
UpdateParameterList();
108109

@@ -112,6 +113,9 @@ protected override void Initialize(BaseGraphView graphView)
112113
});
113114
}
114115

116+
void OnViewClosed(DetachFromPanelEvent evt)
117+
=> Undo.undoRedoPerformed -= UpdateParameterList;
118+
115119
void OnMouseDownEvent(MouseDownEvent evt)
116120
{
117121
blackboardLayouts = content.Children().Select(c => c.layout).ToList();

0 commit comments

Comments
 (0)