From 84ab4f8d1fb0b720b6e3b49800beb2ac96473d97 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 4 Nov 2021 15:56:15 +0100 Subject: [PATCH] person: add the possibility of form data is null on CommentType --- src/Bundle/ChillMainBundle/Form/Type/CommentType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);