diff --git a/src/GraphNavigator/DeserializationGraphNavigator.php b/src/GraphNavigator/DeserializationGraphNavigator.php index 6af96cbee..7c9dbab5a 100644 --- a/src/GraphNavigator/DeserializationGraphNavigator.php +++ b/src/GraphNavigator/DeserializationGraphNavigator.php @@ -123,7 +123,7 @@ public function accept($data, ?array $type = null) // Sometimes data can convey null but is not of a null type. // Visitors can have the power to add this custom null evaluation // If null is explicitly allowed we should skip this - if (!$this->shouldDeserializeNull + if (false === $this->shouldDeserializeNull && $this->visitor instanceof NullAwareVisitorInterface && true === $this->visitor->isNull($data) ) { @@ -215,7 +215,7 @@ public function accept($data, ?array $type = null) try { $v = $this->visitor->visitProperty($propertyMetadata, $data); - if ($v !== null || $this->shouldDeserializeNull === true) { + if (null !== $v || true === $this->shouldDeserializeNull) { $this->accessor->setValue($object, $v, $propertyMetadata, $this->context); } } catch (NotAcceptableException $e) {