// Other normalizers that extend this class may only provide $object that
// implements \Traversable.
if ($object instanceof ComplexDataInterface) {
- $object = TypedDataInternalPropertiesHelper::getNonInternalProperties($object);
+ // If there are no properties to normalize, just normalize the value.
+ $object = !empty($object->getProperties(TRUE))
+ ? TypedDataInternalPropertiesHelper::getNonInternalProperties($object)
+ : $object->getValue();
}
/** @var \Drupal\Core\TypedData\TypedDataInterface $property */
foreach ($object as $name => $property) {