Fix: [center denormalizer] do not throw an error if deserializing a null center

This commit is contained in:
Julien Fastré 2022-12-01 17:58:59 +01:00
parent 1f58acd871
commit 64e65d08fe
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -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');
}