From 5e0a69310887183d1c434ddbe0a73790c7c2ddf0 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 17 Mar 2022 17:51:25 +0100 Subject: [PATCH] commentembeddable: add a condition for the early return in normalisation --- .../Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php index bd812e036..f5b10b9d8 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php @@ -39,7 +39,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa */ public function normalize($object, ?string $format = null, array $context = []): array { - if (null === $object) { + if (null === $object or (null === $object->getComment() and null === $object->getUserId() and null === $object->getDate())) { return [ 'comment' => '', 'isNull' => true,