mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
Fix: [center denormalizer] do not throw an error if deserializing a null center
This commit is contained in:
parent
1f58acd871
commit
64e65d08fe
@ -31,6 +31,10 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
|
|||||||
|
|
||||||
public function denormalize($data, $type, $format = null, array $context = [])
|
public function denormalize($data, $type, $format = null, array $context = [])
|
||||||
{
|
{
|
||||||
|
if (null === $data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (false === array_key_exists('type', $data)) {
|
if (false === array_key_exists('type', $data)) {
|
||||||
throw new InvalidArgumentException('missing "type" key in data');
|
throw new InvalidArgumentException('missing "type" key in data');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user