From cb954e828ed27b3077d4cd8a72aa49488bf0111b Mon Sep 17 00:00:00 2001 From: Mantas Marcinkevicius Date: Wed, 15 Feb 2023 10:29:55 +0200 Subject: [PATCH] fixed normalization of null embedded objects --- Mapping/Converter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mapping/Converter.php b/Mapping/Converter.php index 6778c0f6..2d265f93 100644 --- a/Mapping/Converter.php +++ b/Mapping/Converter.php @@ -47,6 +47,10 @@ public function convertDocumentToArray($document): array protected function normalize($document, $metadata = null) { + if ($document === null) { + return null; + } + $metadata = $metadata ?? $this->propertyMetadata[get_class($document)]; $result = [];