Skip to content

Commit a27e318

Browse files
committed
MAGETWO-56206: API - inconsistency in the Magento response data types
- Fix build failures using DataObject in type checks
1 parent a6ab66c commit a27e318

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/Magento/Framework/Reflection/DataObjectProcessor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ public function buildOutputDataArray($dataObject, $dataObjectType)
9898
$value = $this->customAttributesProcessor->buildOutputDataArray($dataObject, $dataObjectType);
9999
} elseif ($key === "extension_attributes") {
100100
$attributeArray = $this->extensionAttributesProcessor->buildOutputDataArray($value, $returnType);
101-
$value = empty($attributeArray) ? new \Magento\Framework\DataObject() : $attributeArray;
101+
if (!empty($attributeArray)) {
102+
$value = $attributeArray;
103+
}
102104
} else {
103105
if (is_object($value) && !($value instanceof Phrase)) {
104106
$value = $this->buildOutputDataArray($value, $returnType);

0 commit comments

Comments
 (0)