This looks racy. You're sampling the engine variable twice, and it's mutable. Though it never becomes non-null after it becomes null. Still, it's not obvious that this is right.

(One simple fix, only sample the job.engine field once)