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