Добавил проверку на пустое значение
This commit is contained in:
parent
5e470a4497
commit
ef336c0d2e
@ -121,8 +121,7 @@ class Data2DtoConverter
|
|||||||
protected function processClass(object $object, ReflectionProperty $property, string $preparedPropertyType, &$value, array $tags)
|
protected function processClass(object $object, ReflectionProperty $property, string $preparedPropertyType, &$value, array $tags)
|
||||||
{
|
{
|
||||||
if (class_exists($preparedPropertyType)) {
|
if (class_exists($preparedPropertyType)) {
|
||||||
if ($property->isInitialized($object)) {
|
if ($property->isInitialized($object) && $propertyValue = $property->getValue($object)) {
|
||||||
$propertyValue = $property->getValue($object);
|
|
||||||
$value = $this->convert($value, $propertyValue, $tags);
|
$value = $this->convert($value, $propertyValue, $tags);
|
||||||
} else {
|
} else {
|
||||||
$value = $this->convert($value, new $preparedPropertyType, $tags);
|
$value = $this->convert($value, new $preparedPropertyType, $tags);
|
||||||
|
Loading…
Reference in New Issue
Block a user