I have a problem when submitting a from with a related entity. I get the following error message when submitting the form:

Catchable Fatal Error: Argument 1 passed to
My\ReportBundle\Entity\Clearance::setProjectProject() must be an instance of
My\ReportBundle\Entity\Project, null given, called in
/var/www/Symfony/src/My/ReportBundle/Controller/DefaultController.php on line 85 and
defined in /var/www/Symfony/src/My/ReportBundle/Entity/Clearance.php line 272