Cloning a job

After cloning a job, relatedEntities was null instead of an ArrayCollection. Thus, I got an php error because foreach does not like null...