Skip to content

Commit

Permalink
Check for non-null entity
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismacdonaldw committed Nov 1, 2023
1 parent 8f3c74f commit 00e9112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugin/OaiMetadataMap/DgiStandard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 00e9112

Please sign in to comment.