[DoctrineBundle] Form transformers shouldn't explode if they're passed null as a value

This commit is contained in:
Jordi Boggiano 2010-11-09 15:49:22 +01:00 committed by Fabien Potencier
parent 0bdb271608
commit b8987e1bde

View File

@ -138,6 +138,10 @@ class CollectionToStringTransformer extends BaseValueTransformer
*/
public function transform($value)
{
if (null === $value) {
return '';
}
$values = array();
$em = $this->getOption('em');
$reflField = $em->getClassMetadata($this->getOption('class_name'))