diff --git a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php index afcd061e6..3d3f2e9d8 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php @@ -54,7 +54,7 @@ class CommentType extends AbstractType $data = $event->getForm()->getData(); $comment = $event->getData() ?? ['comment' => '']; - if ($data->getComment() !== $comment['comment']) { + if (null !== $data && $data->getComment() !== $comment['comment']) { $data->setDate(new \DateTime()); $data->setUserId($this->user->getId()); $event->getForm()->setData($data);