diff --git a/src/Plugin/OaiMetadataMap/DgiStandard.php b/src/Plugin/OaiMetadataMap/DgiStandard.php index 04fe8e7..3c43fc0 100644 --- a/src/Plugin/OaiMetadataMap/DgiStandard.php +++ b/src/Plugin/OaiMetadataMap/DgiStandard.php @@ -353,7 +353,7 @@ protected function addValues(FieldItemListInterface $items, $metadata_field) { protected function addLinkedAgentValues(EntityReferenceFieldItemListInterface $items) { foreach ($items as $item) { $metadata_field = $this->getLinkedAgentMetadataField($item->getValue()['rel_type']); - if ($metadata_field) { + if ($metadata_field && $item->entity) { $this->elements[$metadata_field][] = $item->entity->label(); } }