Fix crash when spline actor gets removed

(speculative fix)

#3180
This commit is contained in:
Wojtek Figat
2025-03-02 10:45:51 +01:00
parent 7410b506e3
commit 4846852762

View File

@@ -306,6 +306,13 @@ namespace FlaxEditor.SceneGraph.Actors
private void OnUpdate()
{
// Prevent update event called when actor got deleted (incorrect state)
if (!Actor)
{
FlaxEngine.Scripting.Update -= OnUpdate;
return;
}
// If this node's point is selected
var selection = Editor.Instance.SceneEditing.Selection;
if (selection.Count == 1 && selection[0] is SplinePointNode selectedPoint && selectedPoint.ParentNode == this)