From 00e911271ae9e65f1a1ca593de142c898b9b5b49 Mon Sep 17 00:00:00 2001 From: Chris MacDonald <31731869+chrismacdonaldw@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:29:47 -0300 Subject: [PATCH] Check for non-null entity --- src/Plugin/OaiMetadataMap/DgiStandard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } }