Reply To: Bug: Reference lost after recompile

FlowCanvas Forums Support Bug: Reference lost after recompile Reply To: Bug: Reference lost after recompile

#2362
grendelgerard
Participant

I think I traced the bug to the source.

In Graph.cs Serialize() is called after I recompile.

If I look at the list of _objectReferences if the bug occurs, the references that are lost are “null” (not null, but the Unity “null”).

The name field of the “null” reference as the error: UnityEngine.MissingReferenceException: The object of type ‘Condition’ has been destroyed but you are still trying to access it.Your script should either check if it is null or you should not destroy the object.

I’m not sure how Unity works exactly during recompile, but my colleague informs my that during recompile ScriptableObjects that are not referenced can be temporarily destroyed. I’m not sure if this is what triggers this behaviour, but it could be.

At least I’m pretty confident this is the moment and location where this bug is triggered.