Hey! owner == null is actually on purpose 😛 and it is a hack to cleanup the graph if the component is removed from the Unity inspector (right click -> remove component for example).
It’s not really important though, since the GC will clean that up anyway on an enter/exit play mode (as well as other cases).
Not wanting to appear anoying but conditionals are resolved left to right so in this case : owner == null && owner.graph != null
If the following is true : owner == null
then owner will be null and when the next conditional will be resolved (because it is a &&) it will crash because you are using owner : owner.graph != null
You’re both almost right. owner == null could return true but owner could be not null (will be destroyed at the end of the frame). == operator is overriden by Unity.
To prevent null ref exception you should replace condition with this code: owner == null && !ReferenceEquals(owner, null) && owner.graph != null