commentembeddable: add a condition for the early return in normalisation

This commit is contained in:
nobohan 2022-03-17 17:51:25 +01:00
parent 1a783e1881
commit 5e0a693108

View File

@ -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,