Добавил проверку на пустое значение

This commit is contained in:
Sipachev Igor 2021-08-17 16:56:47 +07:00
parent 02f5719514
commit 5e470a4497

View File

@ -72,8 +72,7 @@ class Data2DtoConverter
{ {
$propertyExtractor = new PropertyExtractor($property->class, $property->getName()); $propertyExtractor = new PropertyExtractor($property->class, $property->getName());
if ($propertyExtractor->fetch(VirtualProperty::class)) { if ($propertyExtractor->fetch(VirtualProperty::class)) {
if ($property->isInitialized($object)) { if ($property->isInitialized($object) && $propertyValue = $property->getValue($object)) {
$propertyValue = $property->getValue($object);
$value = $this->convert($data, $propertyValue, $tags); $value = $this->convert($data, $propertyValue, $tags);
} else { } else {
$propertyType = $property->getType()->getName(); $propertyType = $property->getType()->getName();