From 64e65d08feefba7f265d975bb6d0126c440ac0a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 1 Dec 2022 17:58:59 +0100 Subject: [PATCH] Fix: [center denormalizer] do not throw an error if deserializing a null center --- .../Serializer/Normalizer/CenterNormalizer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php index f65e7ebc8..e0b2a3e96 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php @@ -31,6 +31,10 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface public function denormalize($data, $type, $format = null, array $context = []) { + if (null === $data) { + return null; + } + if (false === array_key_exists('type', $data)) { throw new InvalidArgumentException('missing "type" key in data'); }