Skip to content

Commit 96dfd66

Browse files
authored
Merge pull request #128 from nchiasson-dgi/fix/edtfyear-null-paragraph
Adding a null check for the $paragraph_entity
2 parents 2d42fcd + 641a008 commit 96dfd66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Plugin/search_api/processor/EDTFYear.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private function getDateFromParagraphField(EntityInterface $entity, string $bund
251251
$paragraph_entity = $entity->get($paragraph_field_name)
252252
->referencedEntities()[0] ?? NULL;
253253

254-
if ($paragraph_entity->hasField($field_name)
254+
if ($paragraph_entity && $paragraph_entity->hasField($field_name)
255255
&& !$paragraph_entity->get($field_name)->isEmpty()) {
256256
return trim($paragraph_entity->get($field_name)->value);
257257
}

0 commit comments

Comments
 (0)